diff --git a/sessions.h b/sessions.h index e4f798a..357ae4f 100644 --- a/sessions.h +++ b/sessions.h @@ -92,7 +92,7 @@ void setsession(int pid, unsigned int ts_ttl) { snprintf(ts_str, sizeof(ts_str), "%llu", (unsigned long long)time(NULL)); - if (write(fd, ts_str, sizeof(ts_str)) < 0) + if (write(fd, ts_str, strlen(ts_str)) < 0) err(1, "Could not write to %s", path); close(fd); @@ -123,7 +123,6 @@ int getsession(int pid, unsigned int ts_ttl) { err(1, "Could not open %s", path); } - printf("%d", fd); if (read(fd, ts_str, sizeof(ts_str)) < 0) err(1, "Could not read %s", path);