summaryrefslogtreecommitdiffstats
path: root/cgexec.c
diff options
context:
space:
mode:
Diffstat (limited to 'cgexec.c')
-rw-r--r--cgexec.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/cgexec.c b/cgexec.c
index d91207f..9558bca 100644
--- a/cgexec.c
+++ b/cgexec.c
@@ -28,8 +28,6 @@
#include <sys/stat.h>
#include <sys/types.h>
-#define CG_HIER_MAX CG_CONTROLLER_MAX
-#define CG_CONT_NAMELEN_MAX 128
struct cgroup_data {
char path[FILENAME_MAX];
@@ -84,14 +82,12 @@ int parse_cgroup_data(struct cgroup_data *cdptr[], char *optarg)
temp = strtok(NULL, ",");
if (temp) {
- cdptr[i]->controllers[j] =
- (char *) malloc(strlen(temp) + 1);
+ cdptr[i]->controllers[j] = strdup(temp);
if (!cdptr[i]->controllers[j]) {
free(cdptr[i]);
fprintf(stderr, "%s\n", strerror(errno));
return -1;
- } else
- strcpy(cdptr[i]->controllers[j], temp);
+ }
}
j++;
} while (temp);