From: Andre Noll Date: Wed, 30 Oct 2019 09:58:12 +0000 (+0100) Subject: Merge branch 'refs/heads/t/svg-logo' X-Git-Tag: v1.0.1~2 X-Git-Url: http://git.tuebingen.mpg.de/?a=commitdiff_plain;h=a49a95efca7e3b22c1b06b38319fdfbeea8c7fe2;hp=eefbddd33850c724d7b5a07b484b00d0b6821961;p=dss.git Merge branch 'refs/heads/t/svg-logo' Cooking for about a month. The web page has been updated today to use the new logo. * refs/heads/t/svg-logo: Redo the logo as svg. --- diff --git a/daemon.c b/daemon.c index 709785b..ad73061 100644 --- a/daemon.c +++ b/daemon.c @@ -60,7 +60,6 @@ int daemon_init(void) /* become session leader */ if (setsid() < 0) goto err; - umask(0); null = open("/dev/null", O_RDWR); if (null < 0) goto err; diff --git a/dss.c b/dss.c index a219cfd..5f35435 100644 --- a/dss.c +++ b/dss.c @@ -1444,7 +1444,7 @@ static void create_rsync_argv(char ***argv, int64_t *num) OPT_STRING_VAL(DSS, REMOTE_USER) : logname, OPT_STRING_VAL(DSS, REMOTE_HOST), lls_string_val(j, OPT_RESULT(DSS, SOURCE_DIR)), - N == 1? "/" : "" + OPT_GIVEN(DSS, SOURCE_DIR) == 1? "/" : "" ); } } @@ -1567,7 +1567,7 @@ static void exit_hook(int exit_code) { pid_t pid; char **argv, *tmp = dss_strdup(OPT_STRING_VAL(DSS, EXIT_HOOK)); - unsigned n = split_args(tmp, &argv, " \t"); + unsigned n = split_args(tmp, &argv); n++; argv = dss_realloc(argv, (n + 1) * sizeof(char *)); diff --git a/exec.c b/exec.c index 9e0565d..ece7ec2 100644 --- a/exec.c +++ b/exec.c @@ -56,7 +56,7 @@ void dss_exec_cmdline_pid(pid_t *pid, const char *cmdline) { char **argv, *tmp = dss_strdup(cmdline); - split_args(tmp, &argv, " \t"); + split_args(tmp, &argv); dss_exec(pid, argv[0], argv); free(argv); free(tmp); diff --git a/str.c b/str.c index 623def1..1377630 100644 --- a/str.c +++ b/str.c @@ -212,20 +212,21 @@ __must_check __malloc char *dss_logname(void) * * \param args The string to be split. * \param argv_ptr Pointer to the list of substrings. - * \param delim Delimiter. * - * This function modifies \a args by replacing each occurrence of \a delim by - * zero. A \p NULL-terminated array of pointers to char* is allocated dynamically - * and these pointers are initialized to point to the broken-up substrings - * within \a args. A pointer to this array is returned via \a argv_ptr. + * This function modifies the string given by the first argument by replacing + * all occurrences of space and '\t' characters by '\0'. A NULL-terminated + * array of pointers to char * is allocated dynamically, and these pointers are + * initialized to point to the broken-up substrings. A pointer to this array + * is returned via the last argument. * - * \return The number of substrings found in \a args. + * \return The number of substrings found. */ -unsigned split_args(char *args, char *** const argv_ptr, const char *delim) +unsigned split_args(char *args, char *** const argv_ptr) { char *p; char **argv; size_t n = 0, i, j; + const char delim[] = " \t"; p = args + strspn(args, delim); for (;;) { diff --git a/str.h b/str.h index b7f2635..7b121ef 100644 --- a/str.h +++ b/str.h @@ -8,7 +8,7 @@ __must_check __malloc char *dss_strdup(const char *s); __must_check __malloc char *get_homedir(void); int dss_atoi64(const char *str, int64_t *value); __must_check __malloc char *dss_logname(void); -unsigned split_args(char *args, char *** const argv_ptr, const char *delim); +unsigned split_args(char *args, char *** const argv_ptr); /** \cond LLONG_MAX and LLONG_LIN might not be defined. */