git://git.jankratochvil.net
/
gnokii.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implemented aborting on exit of child process of --gnokiid
[gnokii.git]
/
gnokii
/
gnokii.c
diff --git
a/gnokii/gnokii.c
b/gnokii/gnokii.c
index
caec03c
..
e6692ab
100644
(file)
--- a/
gnokii/gnokii.c
+++ b/
gnokii/gnokii.c
@@
-4119,6
+4119,12
@@
int monitormode(int argc, char *argv[])
#ifdef UCLINUX
#ifdef UCLINUX
+static void gnokiid_SIGCHLD(int signo)
+{
+ fprintf (stderr, _("Child process exited, aborting...\n"));
+ exit(2);
+}
+
static int gnokiid(int argc, char *argv[])
{
bool DebugMode; /* When true, run in debug mode */
static int gnokiid(int argc, char *argv[])
{
bool DebugMode; /* When true, run in debug mode */
@@
-4154,15
+4160,15
@@
static int gnokiid(int argc, char *argv[])
#ifdef DEBUG
fprintf (stderr, _("Spawning gnokiid startup child process \"%s\"...\n"), *argv);
#endif
#ifdef DEBUG
fprintf (stderr, _("Spawning gnokiid startup child process \"%s\"...\n"), *argv);
#endif
- /* default action for SIGCHLD is SIG_IGN, should be OK */
+ signal(SIGCHLD,gnokiid_SIGCHLD);
errno=0;
switch (vfork()) {
case -1: /* vfork() failure */
errno=0;
switch (vfork()) {
case -1: /* vfork() failure */
- fprintf (stderr, _("vfork() failed! (%
m)\n"
));
+ fprintf (stderr, _("vfork() failed! (%
s)\n"),strerror(errno
));
return -1;
case 0: /* child */
execv(*argv,argv);
return -1;
case 0: /* child */
execv(*argv,argv);
- fprintf (stderr, _("Spawn of child process failed! (%
m)\n"
));
+ fprintf (stderr, _("Spawn of child process failed! (%
s)\n"),strerror(errno
));
_exit(9);
break;
default: /* parent */
_exit(9);
break;
default: /* parent */