projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: remove use of stat()
[lttng-tools.git]
/
src
/
common
/
utils.c
diff --git
a/src/common/utils.c
b/src/common/utils.c
index 38f78a7e8e7d40cd6fcebefd297e5bb240c52aaf..3e659a1c81079d74b52aab9993c555fcaba6b62d 100644
(file)
--- a/
src/common/utils.c
+++ b/
src/common/utils.c
@@
-22,8
+22,8
@@
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <unistd.h>
#include <inttypes.h>
#include <regex.h>
#include <unistd.h>
#include <inttypes.h>
#include <regex.h>
@@
-248,7
+248,6
@@
LTTNG_HIDDEN
int utils_mkdir_recursive(const char *path, mode_t mode)
{
char *p, tmp[PATH_MAX];
int utils_mkdir_recursive(const char *path, mode_t mode)
{
char *p, tmp[PATH_MAX];
- struct stat statbuf;
size_t len;
int ret;
size_t len;
int ret;
@@
-276,15
+275,12
@@
int utils_mkdir_recursive(const char *path, mode_t mode)
ret = -1;
goto error;
}
ret = -1;
goto error;
}
- ret =
stat(tmp, &statbuf
);
+ ret =
mkdir(tmp, mode
);
if (ret < 0) {
if (ret < 0) {
- ret = mkdir(tmp, mode);
- if (ret < 0) {
- if (errno != EEXIST) {
- PERROR("mkdir recursive");
- ret = -errno;
- goto error;
- }
+ if (errno != EEXIST) {
+ PERROR("mkdir recursive");
+ ret = -errno;
+ goto error;
}
}
*p = '/';
}
}
*p = '/';
This page took
0.023626 seconds
and
4
git commands to generate.