summaryrefslogtreecommitdiff
path: root/usr.bin/at/at.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2016-10-31 17:22:08 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2016-10-31 17:22:08 +0000
commite3ca807125b7e877ad56ed208ddfebb405c9eec5 (patch)
tree2d3e2fff75baeee998116384f5f96307dae81519 /usr.bin/at/at.c
parent49208a5780ce697b5a471deb7b3acae9e368afd1 (diff)
Delete setlocale(LC_TIME, "").
The only place where this could potentially get used was the strftime(3) for fprintf(3) "job %s at %s\n" to stderr. We don't want base system utilities to talk to users in foreign languages. No functional change on OpenBSD which doesn't provide any non-standard LC_TIME locale anyway. Patch from Jan Stary <hans at stare dot cz>. In main(), exit -> return while here. OK millert@
Diffstat (limited to 'usr.bin/at/at.c')
-rw-r--r--usr.bin/at/at.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/usr.bin/at/at.c b/usr.bin/at/at.c
index 407d5df18cf..1781f01c24c 100644
--- a/usr.bin/at/at.c
+++ b/usr.bin/at/at.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: at.c,v 1.77 2015/11/16 16:43:06 millert Exp $ */
+/* $OpenBSD: at.c,v 1.78 2016/10/31 17:22:07 schwarze Exp $ */
/*
* at.c : Put file into atrun queue
@@ -41,7 +41,6 @@
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
-#include <locale.h>
#include <pwd.h>
#include <signal.h>
#include <stdarg.h>
@@ -198,8 +197,6 @@ writefile(const char *cwd, time_t runtimer, char queue)
mode_t cmask;
extern char **environ;
- (void)setlocale(LC_TIME, "");
-
/*
* Install the signal handler for SIGINT; terminate after removing the
* spool file if necessary
@@ -1025,7 +1022,7 @@ main(int argc, char **argv)
case CAT:
if ((aflag && argc) || (!aflag && !argc))
usage();
- exit(process_jobs(argc, argv, program));
+ return process_jobs(argc, argv, program);
break;
case AT:
@@ -1034,7 +1031,7 @@ main(int argc, char **argv)
if (argc == 0)
usage();
else if ((timer = parsetime(argc, argv)) == -1)
- exit(EXIT_FAILURE);
+ return EXIT_FAILURE;
}
writefile(cwd, timer, queue);
break;
@@ -1048,7 +1045,7 @@ main(int argc, char **argv)
if (argc == 0)
timer = time(NULL);
else if ((timer = parsetime(argc, argv)) == -1)
- exit(EXIT_FAILURE);
+ return EXIT_FAILURE;
writefile(cwd, timer, queue);
break;
@@ -1057,5 +1054,5 @@ main(int argc, char **argv)
fatalx("internal error");
break;
}
- exit(EXIT_SUCCESS);
+ return EXIT_SUCCESS;
}