aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael K. Johnson <johnsonm@redhat.com>1999-09-10 13:55:43 +0000
committerMichael K. Johnson <johnsonm@redhat.com>1999-09-10 13:55:43 +0000
commitb59915fa3372aca8bdb9568b72afeb0ec7be723e (patch)
tree43d15b669e135d27e075499ae2e230e9a1cda0d8
parentbee31bfd2be8b71a4aacca36e398a7169c75dff8 (diff)
downloadinitscripts-b59915fa3372aca8bdb9568b72afeb0ec7be723e.tar
initscripts-b59915fa3372aca8bdb9568b72afeb0ec7be723e.tar.gz
initscripts-b59915fa3372aca8bdb9568b72afeb0ec7be723e.tar.bz2
initscripts-b59915fa3372aca8bdb9568b72afeb0ec7be723e.tar.xz
initscripts-b59915fa3372aca8bdb9568b72afeb0ec7be723e.zip
report failure
-rw-r--r--src/ppp-watch.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/ppp-watch.c b/src/ppp-watch.c
index fcf7eaee..ad8e2779 100644
--- a/src/ppp-watch.c
+++ b/src/ppp-watch.c
@@ -92,7 +92,7 @@ cleanExit(int exitCode);
static void
-detach(int now, int parentExitCode) {
+detach(int now, int parentExitCode, char *device) {
static int pipeArray[2];
char exitCode;
@@ -119,6 +119,8 @@ detach(int now, int parentExitCode) {
default: exit (27); /* this will catch EIO in particular */
}
}
+ if (exitCode)
+ fprintf(stderr, "Failed to activate %s\n", device);
exit(exitCode);
} else {
@@ -197,7 +199,7 @@ fork_exec(int wait, char *path, char *arg1, char *arg2, char *arg3)
static void
cleanExit(int exitCode) {
fork_exec(1, "/sbin/netreport", "-r", NULL, NULL);
- detach(1, exitCode);
+ detach(1, exitCode, NULL);
exit(exitCode);
doPidFile(NULL);
}
@@ -330,19 +332,18 @@ main(int argc, char **argv) {
exit(30);
}
- detach(0, 0); /* prepare */
-
-
- if (argc > 2 && !strcmp("boot", argv[2])) {
- theBoot = argv[2];
- }
-
if (!strncmp(argv[1], "ifcfg-", 6)) {
device = argv[1] + 6;
} else {
device = argv[1];
}
+ detach(0, 0, device); /* prepare */
+
+ if (argc > 2 && !strcmp("boot", argv[2])) {
+ theBoot = argv[2];
+ }
+
doPidFile(device);
signal(SIGTERM, signal_handler);
@@ -429,7 +430,7 @@ main(int argc, char **argv) {
if (physicalDevice) {
if (interfaceStatus(physicalDevice)) {
/* device is up */
- detach(1, 0);
+ detach(1, 0, NULL);
connectedOnce = 1;
}
}