mirror of
https://github.com/troglobit/libite.git
synced 2026-11-06 15:50:57 +00:00
4 files changed
+11
-6
No files matched your search
+1
-1
@@ -41,7 +41,7 @@ int fisdir(const char *path)
|
|||||||
{
|
{
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
|
|
||||||
if (!stat(path, &sb) && S_ISDIR(sb.st_mode))
|
if (path && !stat(path, &sb) && S_ISDIR(sb.st_mode))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
+8
-3
@@ -139,10 +139,15 @@ int whichp (const char *cmd);
|
|||||||
*/
|
*/
|
||||||
static inline int touch(const char *path)
|
static inline int touch(const char *path)
|
||||||
{
|
{
|
||||||
|
int fd;
|
||||||
|
|
||||||
if (utimensat(AT_FDCWD, path, NULL, 0)) {
|
if (utimensat(AT_FDCWD, path, NULL, 0)) {
|
||||||
if (errno == ENOENT)
|
if (errno != ENOENT)
|
||||||
return mknod((path), S_IFREG|0644, 0);
|
return -1;
|
||||||
return -1;
|
fd = creat(path, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
|
||||||
|
if (fd < 0)
|
||||||
|
return -1;
|
||||||
|
close(fd);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -41,7 +41,7 @@ static int mtime()
|
|||||||
char buf[80];
|
char buf[80];
|
||||||
|
|
||||||
/* Must sleep a while here otherwise we execute too fast => no mtime change :-( */
|
/* Must sleep a while here otherwise we execute too fast => no mtime change :-( */
|
||||||
usleep(10000);
|
sleep(2);
|
||||||
|
|
||||||
PRINT("Calling pidfile() again to update mtime ...\n");
|
PRINT("Calling pidfile() again to update mtime ...\n");
|
||||||
if (pidfile(pidfile_arg))
|
if (pidfile(pidfile_arg))
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ static int mtime(char *file)
|
|||||||
stat(file, &before);
|
stat(file, &before);
|
||||||
|
|
||||||
/* Must sleep a while here otherwise we execute too fast => no mtime change :-( */
|
/* Must sleep a while here otherwise we execute too fast => no mtime change :-( */
|
||||||
usleep(10000);
|
sleep(2);
|
||||||
|
|
||||||
PRINT("Calling touch() again to update mtime ...\n");
|
PRINT("Calling touch() again to update mtime ...\n");
|
||||||
if (touch(file)) {
|
if (touch(file)) {
|
||||||
|
|||||||
Reference in new issue
Block a user