diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2015-07-31 15:44:29 +0200 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2015-07-31 15:44:29 +0200 |
commit | 9fa8486900284d78b8255b2116af9a0b0ef11a46 (patch) | |
tree | dfa799c4ec566e77618c23118dca4efb8ff76556 /nq.c | |
parent | 240b5027e10ab46ae540f3e47f659f731f7401c4 (diff) | |
download | nq-9fa8486900284d78b8255b2116af9a0b0ef11a46.tar.gz nq-9fa8486900284d78b8255b2116af9a0b0ef11a46.tar.xz nq-9fa8486900284d78b8255b2116af9a0b0ef11a46.zip |
cleanups, usage
Diffstat (limited to 'nq.c')
-rw-r--r-- | nq.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/nq.c b/nq.c index 69d478c..ccd3a7a 100644 --- a/nq.c +++ b/nq.c @@ -54,16 +54,21 @@ write_execline(int fd, int argc, char *argv[]) int main(int argc, char *argv[]) { - pid_t child; int dirfd, lockfd; - char lockfile[32]; int pipefd[2]; - struct timeval tv; + char lockfile[32]; + pid_t child; + struct timeval started; struct dirent *ent; /* timestamp is milliseconds since epoch. */ - gettimeofday(&tv, NULL); - int64_t ms = tv.tv_sec*1000 + tv.tv_usec/1000; + gettimeofday(&started, NULL); + int64_t ms = started.tv_sec*1000 + started.tv_usec/1000; + + if (argc <= 1) { + swrite(2, "usage: nq CMD...\n"); + exit(1); + } char *path = getenv("NQDIR"); if (!path) |