diff options
| author | Jonathan Bauer | 2015-05-27 16:32:57 +0200 |
|---|---|---|
| committer | Jonathan Bauer | 2015-05-27 16:32:57 +0200 |
| commit | 0abace2bbec9e17a3630c463e4e3c329c967334b (patch) | |
| tree | 986a9bebd62c2dd596c85bf44bbec68d00cccd13 /testModule/systemd-preserve-process-marker.c | |
| parent | removed hacked systemd rpms and grub2.conf (diff) | |
| download | systemd-init-0abace2bbec9e17a3630c463e4e3c329c967334b.tar.gz systemd-init-0abace2bbec9e17a3630c463e4e3c329c967334b.tar.xz systemd-init-0abace2bbec9e17a3630c463e4e3c329c967334b.zip | |
restructuring & bit of documentation ;)
dracut module now in 'dnbd3-qcow2-rootfs'. ALLLLL dracut related stuff goes in here!
Diffstat (limited to 'testModule/systemd-preserve-process-marker.c')
| -rw-r--r-- | testModule/systemd-preserve-process-marker.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/testModule/systemd-preserve-process-marker.c b/testModule/systemd-preserve-process-marker.c deleted file mode 100644 index 8f0fc108..00000000 --- a/testModule/systemd-preserve-process-marker.c +++ /dev/null @@ -1,33 +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; - // Last item acts as null pointer. - char **copy = calloc(sizeof(char *), argc); - // Slice first given command line argument. - 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. - argv[0][0] = '@'; - copy[0][0] = '@'; - if (-1 == execvp(argv[1], copy)) { - perror("Executing child process failed."); - return -1; - } -} |
