projects
/
platform
/
upstream
/
lz4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9474b70
)
[lz4io] Refuse to set file stat for non-regular files
author
Nick Terrell
<terrelln@fb.com>
Fri, 5 Jan 2018 19:32:04 +0000
(11:32 -0800)
committer
Nick Terrell
<terrelln@fb.com>
Fri, 5 Jan 2018 19:54:35 +0000
(11:54 -0800)
programs/util.h
patch
|
blob
|
history
diff --git
a/programs/util.h
b/programs/util.h
index
1382cab
..
fc7f63e
100644
(file)
--- a/
programs/util.h
+++ b/
programs/util.h
@@
-265,11
+265,17
@@
UTIL_STATIC void UTIL_waitForNextTick(void)
#endif
+UTIL_STATIC int UTIL_isRegFile(const char* infilename);
+
+
UTIL_STATIC int UTIL_setFileStat(const char *filename, stat_t *statbuf)
{
int res = 0;
struct utimbuf timebuf;
+ if (!UTIL_isRegFile(filename))
+ return -1;
+
timebuf.actime = time(NULL);
timebuf.modtime = statbuf->st_mtime;
res += utime(filename, &timebuf); /* set access and modification times */