MCPcopy Index your code
hub / github.com/RsyncProject/rsync / set_env_num

Function set_env_num

clientserver.c:482–497  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

480}
481
482void set_env_num(const char *var, long num)
483{
484#ifdef HAVE_SETENV
485 char val[64];
486 (void)snprintf(val, sizeof val, "%ld", num);
487 if (setenv(var, val, 1) < 0)
488 out_of_memory("set_env_str");
489#else
490#ifdef HAVE_PUTENV
491 char *mem;
492 if (asprintf(&mem, "%s=%ld", var, num) < 0)
493 out_of_memory("set_env_num");
494 putenv(mem);
495#endif
496#endif
497}
498
499/* Used for "early exec", "pre-xfer exec", and the "name converter" script. */
500static pid_t start_pre_exec(const char *cmd, int *arg_fd_ptr, int *error_fd_ptr)

Callers 2

start_clientFunction · 0.85
rsync_moduleFunction · 0.85

Calls 1

asprintfFunction · 0.85

Tested by

no test coverage detected