From b9fd788f0e8adacc33316107594e9eb0463743d7 Mon Sep 17 00:00:00 2001 From: Bruce Cran Date: Mon, 20 Feb 2012 17:01:46 +0000 Subject: Add OS_PATH_SEPARATOR for platforms which have different path separator characters (e.g. Windows and 'classic' MacOS). Signed-off-by: Jens Axboe --- cgroup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cgroup.c') diff --git a/cgroup.c b/cgroup.c index de00d986..ea6bbd69 100644 --- a/cgroup.c +++ b/cgroup.c @@ -86,9 +86,9 @@ static char *get_cgroup_root(struct thread_data *td, char *mnt) char *str = malloc(64); if (td->o.cgroup) - sprintf(str, "%s/%s", mnt, td->o.cgroup); + sprintf(str, "%s%s%s", mnt, FIO_OS_PATH_SEPARATOR, td->o.cgroup); else - sprintf(str, "%s/%s", mnt, td->o.name); + sprintf(str, "%s%s%s", mnt, FIO_OS_PATH_SEPARATOR, td->o.name); return str; } @@ -99,8 +99,8 @@ static int write_int_to_file(struct thread_data *td, const char *path, { char tmp[256]; FILE *f; - - sprintf(tmp, "%s/%s", path, filename); + + sprintf(tmp, "%s%s%s", path, FIO_OS_PATH_SEPARATOR, filename); f = fopen(tmp, "w"); if (!f) { td_verror(td, errno, onerr); -- cgit v1.2.3