/*
- * Copyright (C) 2013 Eric Biggers
+ * unix_capture.c: Capture a directory tree on UNIX.
+ */
+
+/*
+ * Copyright (C) 2012, 2013 Eric Biggers
*
* This file is part of wimlib, a library for working with WIM files.
*
#include <dirent.h>
#include <errno.h>
-#include <unistd.h>
+#include <limits.h>
#include <sys/stat.h>
+#include <unistd.h>
static int
unix_capture_regular_file(const char *path,
if (!dir) {
ERROR_WITH_ERRNO("Failed to open the directory `%s'",
path);
- return WIMLIB_ERR_OPEN;
+ return WIMLIB_ERR_OPENDIR;
}
/* Recurse on directory contents */
stat_fn = lstat;
ret = (*stat_fn)(path, &stbuf);
- if (ret != 0) {
+ if (ret) {
ERROR_WITH_ERRNO("Failed to stat `%s'", path);
+ ret = WIMLIB_ERR_STAT;
goto out;
}
if (!S_ISREG(stbuf.st_mode) && !S_ISDIR(stbuf.st_mode)