diff options
author | Dhaval Giani <dhaval@linux.vnet.ibm.com> | 2008-08-13 19:35:01 +0000 |
---|---|---|
committer | Dhaval Giani <dhaval@linux.vnet.ibm.com> | 2008-08-13 19:35:01 +0000 |
commit | 5d3c683a3f4160cb4d081a3ddcf367311ddf0c8b (patch) | |
tree | fcb3bc308190d622eb1559714b82d8372e38a5e5 /file-ops.c | |
parent | 5c16f4a02dfee006b7fb8a04162ed511e3abc481 (diff) | |
download | libcg-5d3c683a3f4160cb4d081a3ddcf367311ddf0c8b.tar.gz libcg-5d3c683a3f4160cb4d081a3ddcf367311ddf0c8b.tar.xz libcg-5d3c683a3f4160cb4d081a3ddcf367311ddf0c8b.zip |
libcgroup: Configuration and parsing updates (v2)
Dhaval, wanted a patch with -p1 generated so that he can apply it and
use it with quilt. Here goes
Testing
Tested with samples/cgconfig.conf (NOTE: expects user balbir to be
present on the system, feel free to change and test).
TODO
1. Add hooks for other controllers, namely memory, cpuacct and cpuset
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@134 4f4bb910-9a46-0410-90c8-c897d4f1cd53
Diffstat (limited to 'file-ops.c')
-rw-r--r-- | file-ops.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -60,10 +60,10 @@ int cg_chown_file(FTS *fts, FTSENT *ent, uid_t owner, gid_t group) /* * TODO: Need to decide a better place to put this function. */ -int cg_chown_recursive(const char *path, uid_t owner, gid_t group) +int cg_chown_recursive(char *path[], uid_t owner, gid_t group) { int ret = 1; - FTS *fts = fts_open((char **)&path, FTS_PHYSICAL | FTS_NOCHDIR | + FTS *fts = fts_open((char **)path, FTS_PHYSICAL | FTS_NOCHDIR | FTS_NOSTAT, NULL); while (1) { FTSENT *ent; @@ -96,10 +96,10 @@ char *cg_build_group_path(struct cg_group *cg_group, return group_path; } -int cg_make_directory(struct cg_group *cg_group, const char *group_path) +int cg_make_directory(struct cg_group *cg_group, char *group_path[]) { int ret; - ret = mkdir(group_path, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); + ret = mkdir(group_path[0], S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); if (ret < 0) return 0; /* @@ -130,8 +130,8 @@ int cg_mount_controllers(void) * Check if path needs to be created before mounting */ if (errno == ENOENT) { - ret = mkdir(curr->mount_point, S_IRWXU | - S_IRWXG | S_IROTH | S_IXOTH); + ret = mkdir(curr->mount_point, S_IRWXU | S_IRWXG | + S_IRWXO | S_ISVTX); if (ret < 0) return 0; } else if (!S_ISDIR(buf.st_mode)) { |