diff options
| author | torben | 2015-04-20 14:44:12 +0200 |
|---|---|---|
| committer | torben | 2015-04-20 14:44:12 +0200 |
| commit | 81e7552e02341e6bff0ac1daccbe9156fbd1d147 (patch) | |
| tree | 3cfe9fe7ea679cfdcbcce3634a3dc59e4355cb91 /testModule/systemd_preserve_process_marker.c | |
| parent | Merge branch 'master' of git.openslx.org:openslx-ng/systemd-init (diff) | |
| download | systemd-init-81e7552e02341e6bff0ac1daccbe9156fbd1d147.tar.gz systemd-init-81e7552e02341e6bff0ac1daccbe9156fbd1d147.tar.xz systemd-init-81e7552e02341e6bff0ac1daccbe9156fbd1d147.zip | |
Cleanup refactoring. Evaluate minimal needed dependencies.
Diffstat (limited to 'testModule/systemd_preserve_process_marker.c')
| -rw-r--r-- | testModule/systemd_preserve_process_marker.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/testModule/systemd_preserve_process_marker.c b/testModule/systemd_preserve_process_marker.c deleted file mode 100644 index 172a5546..00000000 --- a/testModule/systemd_preserve_process_marker.c +++ /dev/null @@ -1,31 +0,0 @@ -#include <unistd.h> -#include <stdlib.h> -#include <string.h> -#include <stdio.h> - -void print_array(int argc, char *argv[]) { - // Helper function to print given array with given length. - int i = 0; - int j = 0; - for (i = 0; i < argc; i ++) { - j = 0; - while(argv[i][j] != '\0') - printf("%c", argv[i][j++]); - printf(" "); - } - printf("\n"); -} -int main(int argc, char *argv[]) { - int count; - char **copy = malloc(sizeof(char *) * (argc-1)); - for (count = 0; count < argc - 1; count++) - copy[count] = strdup(argv[count + 1]); - // Adding systemd indicator to preserve wrapped process during changing - // root filesystem. We mark wrapper and child process. - copy[0][0] = '@'; - argv[0][0] = '@'; - if (-1 == execvp(argv[1], copy)) { - perror("child process execve failed [%m]"); - return -1; - } -} |
