***/
#include <errno.h>
-#include <fcntl.h>
#include <locale.h>
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>
-#include "def.h"
#include "pty.h"
#include "util.h"
static sd_event *event;
static void run_child(Pty *pty) {
- int r, l;
+ ssize_t r, l;
char buf[512];
r = read(0, buf, sizeof(buf));
- assert_se(r == strlen(sndmsg));
+ assert_se((size_t)r == strlen(sndmsg));
assert_se(!strncmp(buf, sndmsg, r));
l = write(1, buf, r);
static void test_pty(void) {
pid_t pid;
- Pty *pty;
+ Pty *pty = NULL;
rcvsiz = 0;
- memset(rcvbuf, 0, sizeof(rcvbuf));
+ zero(rcvbuf);
assert_se(sd_event_default(&event) >= 0);