Deleted Added
full compact
command.c (28679) command.c (28974)
1/*
2 * PPP User command processing module
3 *
4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp)
5 *
6 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
7 *
8 * Redistribution and use in source and binary forms are permitted
9 * provided that the above copyright notice and this paragraph are
10 * duplicated in all such forms and that any documentation,
11 * advertising materials, and other materials related to such
12 * distribution and use acknowledge that the software was developed
13 * by the Internet Initiative Japan, Inc. The name of the
14 * IIJ may not be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 *
1/*
2 * PPP User command processing module
3 *
4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp)
5 *
6 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
7 *
8 * Redistribution and use in source and binary forms are permitted
9 * provided that the above copyright notice and this paragraph are
10 * duplicated in all such forms and that any documentation,
11 * advertising materials, and other materials related to such
12 * distribution and use acknowledge that the software was developed
13 * by the Internet Initiative Japan, Inc. The name of the
14 * IIJ may not be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 *
20 * $Id: command.c,v 1.74 1997/08/21 17:07:30 brian Exp $
20 * $Id: command.c,v 1.75 1997/08/25 00:29:08 brian Exp $
21 *
22 */
23#include <sys/types.h>
24#include <sys/stat.h>
25#include <ctype.h>
26#include <termios.h>
27#include <sys/wait.h>
28#include <time.h>

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

291 argv[i] = strdup(IfDevName);
292 else if (strcasecmp(argv[i], "MYADDR") == 0)
293 argv[i] = strdup(inet_ntoa(IpcpInfo.want_ipaddr));
294 if (bg) {
295 pid_t p;
296
297 p = getpid();
298 if (daemon(1, 1) == -1) {
21 *
22 */
23#include <sys/types.h>
24#include <sys/stat.h>
25#include <ctype.h>
26#include <termios.h>
27#include <sys/wait.h>
28#include <time.h>

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

291 argv[i] = strdup(IfDevName);
292 else if (strcasecmp(argv[i], "MYADDR") == 0)
293 argv[i] = strdup(inet_ntoa(IpcpInfo.want_ipaddr));
294 if (bg) {
295 pid_t p;
296
297 p = getpid();
298 if (daemon(1, 1) == -1) {
299 LogPrintf(LogERROR, "%d: daemon: %s", p, strerror(errno));
299 LogPrintf(LogERROR, "%d: daemon: %s\n", p, strerror(errno));
300 exit(1);
301 }
302 }
303 (void) execvp(argv[0], argv);
304 } else
305 (void) execl(shell, shell, NULL);
306
307 LogPrintf(LogWARN, "exec() of %s failed\n", argc > 0 ? argv[0] : shell);

--- 1208 unchanged lines hidden ---
300 exit(1);
301 }
302 }
303 (void) execvp(argv[0], argv);
304 } else
305 (void) execl(shell, shell, NULL);
306
307 LogPrintf(LogWARN, "exec() of %s failed\n", argc > 0 ? argv[0] : shell);

--- 1208 unchanged lines hidden ---