Fix logic

This commit is contained in:
Roy Marples 2009-11-13 22:29:01 +00:00
parent 89a2d76772
commit 0de1d18d41

View File

@ -72,7 +72,6 @@ swclock(int argc, char **argv)
const char *file = RC_SHUTDOWNTIME; const char *file = RC_SHUTDOWNTIME;
struct stat sb; struct stat sb;
struct timeval tv; struct timeval tv;
void (*e)(const char * __EINFO_RESTRICT, ...) EINFO_XPRINTF(1, 2);
while ((opt = getopt_long(argc, argv, getoptstring, while ((opt = getopt_long(argc, argv, getoptstring,
longopts, (int *) 0)) != -1) longopts, (int *) 0)) != -1)
@ -104,11 +103,11 @@ swclock(int argc, char **argv)
} }
if (stat(file, &sb) == -1) { if (stat(file, &sb) == -1) {
if (wflag != 0 && errno == EEXIST) if (wflag != 0 && errno == ENOENT)
e = ewarnx; ewarn("swclock: `%s': %s", file, strerror(errno));
else else
e = eerrorx; eerrorx("swclock: `%s': %s", file, strerror(errno));
e("swclock: `%s': %s", file, strerror(errno)); return 0;
} }
tv.tv_sec = sb.st_mtime; tv.tv_sec = sb.st_mtime;