summaryrefslogtreecommitdiffstats
path: root/testModule/wrap.c
diff options
context:
space:
mode:
authortorben2015-04-13 20:09:38 +0200
committertorben2015-04-13 20:09:38 +0200
commit91cc532a55fed3c6c27a2e14759e901ed3d72579 (patch)
tree18cc276173bc543b38e84143674429a306c26f0e /testModule/wrap.c
parentAdding endless test service. Fix some naming conventions. (diff)
downloadsystemd-init-91cc532a55fed3c6c27a2e14759e901ed3d72579.tar.gz
systemd-init-91cc532a55fed3c6c27a2e14759e901ed3d72579.tar.xz
systemd-init-91cc532a55fed3c6c27a2e14759e901ed3d72579.zip
Code refactoring.
Diffstat (limited to 'testModule/wrap.c')
-rw-r--r--testModule/wrap.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/testModule/wrap.c b/testModule/wrap.c
deleted file mode 100644
index bfb0b881..00000000
--- a/testModule/wrap.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-void arg_print(int argc, char *argv[]) {
- 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[]) {
-
- arg_print(argc, argv);
-
- int count;
- char **copy = malloc(sizeof(char *) * (argc-1));
- for ( count = 0; count < argc - 1; count++ ) {
- copy[count] = strdup(argv[count + 1]);
- }
-
- arg_print(argc - 1, copy);
-
- copy[0][0] = '@';
- argv[0][0] = '@';
-
- arg_print(argc - 1, copy);
-
- if (-1 == execvp(argv[1], copy)) {
- perror("child process execve failed [%m]");
- return -1;
- }
-}