diff options
Diffstat (limited to 'sysdeps/mach/hurd/mkdirat.c')
-rw-r--r-- | sysdeps/mach/hurd/mkdirat.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sysdeps/mach/hurd/mkdirat.c b/sysdeps/mach/hurd/mkdirat.c index 9201f7d35e..d6d672ead9 100644 --- a/sysdeps/mach/hurd/mkdirat.c +++ b/sysdeps/mach/hurd/mkdirat.c @@ -1,6 +1,5 @@ /* Create a directory named relative to another open directory. Hurd version. - Copyright (C) 1991,1993,1994,1995,1996,1997,2002,2006 - Free Software Foundation, Inc. + Copyright (C) 1991-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,6 +21,7 @@ #include <sys/stat.h> #include <hurd.h> #include <hurd/fd.h> +#include <string.h> int mkdirat (fd, path, mode) @@ -31,7 +31,10 @@ mkdirat (fd, path, mode) { error_t err; const char *name; - file_t parent = __directory_name_split_at (fd, path, (char **) &name); + file_t parent; + if (!strcmp (path, "/")) + return __hurd_fail (EEXIST); + parent = __directory_name_split_at (fd, path, (char **) &name); if (parent == MACH_PORT_NULL) return -1; err = __dir_mkdir (parent, name, mode & ~_hurd_umask); |