repositories
/
mTask.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Button implemented
[mTask.git]
/
int
/
interface_linux.c
diff --git
a/int/interface_linux.c
b/int/interface_linux.c
index
33fd003
..
381df88
100644
(file)
--- a/
int/interface_linux.c
+++ b/
int/interface_linux.c
@@
-49,7
+49,6
@@
bool input_available(void){
pdie("select");
if(!FD_ISSET(fd, &fds))
return false;
pdie("select");
if(!FD_ISSET(fd, &fds))
return false;
- read(fd, &bt, 1);
return true;
}
return true;
}
@@
-144,7
+143,26
@@
void setup(void)
pdie("accept");
}
pdie("accept");
}
-void test(void)
+void debug(char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ fprintf(stderr, "\n");
+ va_end(ap);
+}
+
+void pdie(char *s)
{
{
+ perror(s);
+ die("");
+}
+void die(char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ exit(EXIT_FAILURE);
}
}