diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-18 18:17:42 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-18 18:17:42 +0200 |
commit | d66a818355d0c1a81be580f8bca13dc02bdbe045 (patch) | |
tree | e8ee87e5a2d07078c032aec39c3c81eb9e8b3522 /wiki.c | |
parent | lör 16 sep 2023 20:46:57 CEST (diff) | |
download | wiki-public-d66a818355d0c1a81be580f8bca13dc02bdbe045.tar.gz wiki-public-d66a818355d0c1a81be580f8bca13dc02bdbe045.tar.xz |
mån 18 sep 2023 18:17:41 CEST
Diffstat (limited to '')
-rw-r--r-- | wiki.c | 27 |
1 files changed, 15 insertions, 12 deletions
@@ -177,9 +177,9 @@ static void *start_thread(void *d) { fprintf(stderr, "Signaled\n"); munmap(data->cond, sizeof data->cond); - struct timeval timeout = { - .tv_sec = 1, - }; + // struct timeval timeout = { + // .tv_sec = 1, + // }; int count; @@ -496,6 +496,7 @@ int errfunc(const char *path, int err) { return 0; } +#if 0 int commit_ammend (const char* action, const char *msg) { char *buf = NULL; @@ -506,11 +507,12 @@ int commit_ammend (const char* action, const char *msg) { struct tm result; if (localtime_r(&now, &result) == NULL) { msg = "Now"; + } else { + buf = malloc(1024); + /* TODO check result */ + strftime(buf, 1024, DATE_FORMAT, &result); + msg = buf; } - buf = malloc(1024); - /* TODO check result */ - strftime(buf, 1024, DATE_FORMAT, &result); - msg = buf; } @@ -523,9 +525,10 @@ int commit_ammend (const char* action, const char *msg) { return 0; } +#endif -int git(size_t argc, const char *argv[]) { #if 0 +int git(size_t argc, const char *argv[]) { pid_t pid; int ret; @@ -567,9 +570,9 @@ int git(size_t argc, const char *argv[]) { } return ret; -#endif return 0; } +#endif void print_available_wikis() { printf( @@ -645,12 +648,12 @@ int wiki_do(const char *wiki_root, } if (cmp("echo", command[0])) { syslog(3, "-- %s --", wiki); - char *buf = malloc(0x100); + // char *buf = malloc(0x100); // sprintf(buf, "/tmp/hugo/%i", getpid()); // FILE *log = fopen("/tmp/hugo/log", "a"); // fprintf(log, "Gonna write!\n"); - int count = printf("-- %s --\n", wiki); + /* int count = */printf("-- %s --\n", wiki); fflush(stdout); // fprintf(log, "Wrote %i bytes\n", count); @@ -671,7 +674,7 @@ int wiki_do(const char *wiki_root, } closedir(d); #endif - // free(buf); + free(buf); // :fclose(log); // fflush()q |