Deleted Added
full compact
crontab.c (8857) crontab.c (15161)
1/* Copyright 1988,1990,1993,1994 by Paul Vixie
2 * All rights reserved
3 *
4 * Distribute freely, except: don't remove my name from the source or
5 * documentation (don't take credit for my work), mark your changes (don't
6 * get me blamed for your possible bugs), don't alter or remove this
7 * notice. May be sold if buildable source is provided to buyer. No
8 * warrantee of any kind, express or implied, is included with this
9 * software; use at your own risk, responsibility for damages (if any) to
10 * anyone resulting from the use of this software rests entirely with the
11 * user.
12 *
13 * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
14 * I'll try to keep a version up to date. I can be reached as follows:
15 * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
16 * From Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp
17 */
18
19#if !defined(lint) && !defined(LINT)
1/* Copyright 1988,1990,1993,1994 by Paul Vixie
2 * All rights reserved
3 *
4 * Distribute freely, except: don't remove my name from the source or
5 * documentation (don't take credit for my work), mark your changes (don't
6 * get me blamed for your possible bugs), don't alter or remove this
7 * notice. May be sold if buildable source is provided to buyer. No
8 * warrantee of any kind, express or implied, is included with this
9 * software; use at your own risk, responsibility for damages (if any) to
10 * anyone resulting from the use of this software rests entirely with the
11 * user.
12 *
13 * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
14 * I'll try to keep a version up to date. I can be reached as follows:
15 * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
16 * From Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp
17 */
18
19#if !defined(lint) && !defined(LINT)
20static char rcsid[] = "$Id: crontab.c,v 1.2 1994/12/21 11:06:08 ache Exp $";
20static char rcsid[] = "$Id: crontab.c,v 1.3 1995/05/30 03:47:04 rgrimes Exp $";
21#endif
22
23/* crontab - install and manage per-user crontab files
24 * vix 02may87 [RCS has the rest of the log]
25 * vix 26jan87 [original]
26 */
27
28

--- 370 unchanged lines hidden (view full) ---

399 perror("chdir(/tmp)");
400 exit(ERROR_EXIT);
401 }
402 if (strlen(editor) + strlen(Filename) + 2 >= MAX_TEMPSTR) {
403 fprintf(stderr, "%s: editor or filename too long\n",
404 ProgramName);
405 exit(ERROR_EXIT);
406 }
21#endif
22
23/* crontab - install and manage per-user crontab files
24 * vix 02may87 [RCS has the rest of the log]
25 * vix 26jan87 [original]
26 */
27
28

--- 370 unchanged lines hidden (view full) ---

399 perror("chdir(/tmp)");
400 exit(ERROR_EXIT);
401 }
402 if (strlen(editor) + strlen(Filename) + 2 >= MAX_TEMPSTR) {
403 fprintf(stderr, "%s: editor or filename too long\n",
404 ProgramName);
405 exit(ERROR_EXIT);
406 }
407 sprintf(q, "%s %s", editor, Filename);
408 execlp(_PATH_BSHELL, _PATH_BSHELL, "-c", q, NULL);
407 execlp(editor, editor, Filename, NULL);
409 perror(editor);
410 exit(ERROR_EXIT);
411 /*NOTREACHED*/
412 default:
413 /* parent */
414 break;
415 }
416
417 /* parent */
408 perror(editor);
409 exit(ERROR_EXIT);
410 /*NOTREACHED*/
411 default:
412 /* parent */
413 break;
414 }
415
416 /* parent */
417 {
418 void (*f[4])();
419 f[0] = signal(SIGHUP, SIG_IGN);
420 f[1] = signal(SIGINT, SIG_IGN);
421 f[2] = signal(SIGTERM, SIG_IGN);
418 xpid = wait(&waiter);
422 xpid = wait(&waiter);
423 signal(SIGHUP, f[0]);
424 signal(SIGINT, f[1]);
425 signal(SIGTERM, f[2]);
426 }
419 if (xpid != pid) {
420 fprintf(stderr, "%s: wrong PID (%d != %d) from \"%s\"\n",
421 ProgramName, xpid, pid, editor);
422 goto fatal;
423 }
424 if (WIFEXITED(waiter) && WEXITSTATUS(waiter)) {
425 fprintf(stderr, "%s: \"%s\" exited with status %d\n",
426 ProgramName, editor, WEXITSTATUS(waiter));

--- 197 unchanged lines hidden ---
427 if (xpid != pid) {
428 fprintf(stderr, "%s: wrong PID (%d != %d) from \"%s\"\n",
429 ProgramName, xpid, pid, editor);
430 goto fatal;
431 }
432 if (WIFEXITED(waiter) && WEXITSTATUS(waiter)) {
433 fprintf(stderr, "%s: \"%s\" exited with status %d\n",
434 ProgramName, editor, WEXITSTATUS(waiter));

--- 197 unchanged lines hidden ---