File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
1
SHELL =bash
2
- CFLAGS =-std =gnu99 -static -s -Wall -Werror -O3
2
+ CFLAGS_AUTO =-std =gnu99 -static-pie -s -Wall -Werror -O3
3
3
4
4
TEST_PACKAGE_DEPS := build-essential python python-pip procps python-dev python-setuptools
5
5
@@ -8,7 +8,7 @@ VERSION = $(shell cat VERSION)
8
8
9
9
.PHONY : build
10
10
build : VERSION.h
11
- $(CC ) $(CFLAGS ) -o dumb-init dumb-init.c
11
+ $(CC ) $(CFLAGS_AUTO ) $( CFLAGS ) -o dumb-init dumb-init.c
12
12
13
13
VERSION.h : VERSION
14
14
echo ' // THIS FILE IS AUTOMATICALLY GENERATED' > VERSION.h
Original file line number Diff line number Diff line change @@ -292,9 +292,9 @@ int main(int argc, char *argv[]) {
292
292
}
293
293
}
294
294
295
- child_pid = fork ();
295
+ child_pid = vfork ();
296
296
if (child_pid < 0 ) {
297
- PRINTERR ("Unable to fork . Exiting.\n" );
297
+ PRINTERR ("Unable to vfork . Exiting.\n" );
298
298
return 1 ;
299
299
} else if (child_pid == 0 ) {
300
300
/* child */
@@ -306,7 +306,7 @@ int main(int argc, char *argv[]) {
306
306
errno ,
307
307
strerror (errno )
308
308
);
309
- exit (1 );
309
+ _exit (1 );
310
310
}
311
311
312
312
if (ioctl (STDIN_FILENO , TIOCSCTTY , 0 ) == -1 ) {
@@ -322,7 +322,7 @@ int main(int argc, char *argv[]) {
322
322
323
323
// if this point is reached, exec failed, so we should exit nonzero
324
324
PRINTERR ("%s: %s\n" , cmd [0 ], strerror (errno ));
325
- return 2 ;
325
+ _exit ( 2 ) ;
326
326
} else {
327
327
/* parent */
328
328
DEBUG ("Child spawned with PID %d.\n" , child_pid );
@@ -337,4 +337,6 @@ int main(int argc, char *argv[]) {
337
337
handle_signal (signum );
338
338
}
339
339
}
340
+
341
+ return 1 ;
340
342
}
You can’t perform that action at this time.
0 commit comments