Fix #11: Allow relative paths to touch()

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2017-12-21 14:17:43 +01:00
parent 123108fbf9
commit 3a26ab28b2
+1 -1
View File
@@ -99,7 +99,7 @@ static inline int touch(const char *path)
{
if (mknod((path), S_IFREG|0644, 0)) {
if (errno == EEXIST)
return utimensat(0, path, NULL, 0);
return utimensat(AT_FDCWD, path, NULL, 0);
return -1;
}
return 0;