public
/
FUZIX.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e02753a
)
init: trivial error path fix
author
Alan Cox
<alan@linux.intel.com>
Wed, 19 Oct 2016 20:05:26 +0000
(21:05 +0100)
committer
Alan Cox
<alan@linux.intel.com>
Wed, 19 Oct 2016 20:05:26 +0000
(21:05 +0100)
Applications/util/init.c
patch
|
blob
|
history
diff --git
a/Applications/util/init.c
b/Applications/util/init.c
index
7898844
..
46cb090
100644
(file)
--- a/
Applications/util/init.c
+++ b/
Applications/util/init.c
@@
-137,8
+137,9
@@
static pid_t spawn_process(uint8_t * p, uint8_t wait)
/* Check for internal processes */
if (strcmp(args[2], "getty") == 0)
- pid = getty(args + 3, p + 1);
- else {
+ if ((pid = getty(args + 3, p + 1) == -1)
+ return 0;
+ } else {
/* External */
pid = fork();
if (pid == -1) {
@@
-712,6
+713,7
@@
static pid_t getty(const char **argv, const char *id)
pid = fork();
if (pid == -1) {
putstr("init: can't fork\n");
+ return -1;
} else {
if (pid != 0)
/* parent's context: return pid of the child process */