| 1730 | |
| 1731 | |
| 1732 | int main(int argc,char *argv[]) |
| 1733 | { |
| 1734 | int ret; |
| 1735 | |
| 1736 | raw_argc = argc; |
| 1737 | raw_argv = argv; |
| 1738 | |
| 1739 | #ifdef HAVE_SIGACTION |
| 1740 | # ifdef HAVE_SIGPROCMASK |
| 1741 | sigset_t sigmask; |
| 1742 | |
| 1743 | sigemptyset(&sigmask); |
| 1744 | # endif |
| 1745 | sigact.sa_flags = SA_NOCLDSTOP; |
| 1746 | #endif |
| 1747 | SIGACTMASK(SIGUSR1, sigusr1_handler); |
| 1748 | SIGACTMASK(SIGUSR2, sigusr2_handler); |
| 1749 | SIGACTMASK(SIGCHLD, remember_children); |
| 1750 | #ifdef MAINTAINER_MODE |
| 1751 | SIGACTMASK(SIGSEGV, rsync_panic_handler); |
| 1752 | SIGACTMASK(SIGFPE, rsync_panic_handler); |
| 1753 | SIGACTMASK(SIGABRT, rsync_panic_handler); |
| 1754 | SIGACTMASK(SIGBUS, rsync_panic_handler); |
| 1755 | #endif |
| 1756 | #ifdef SIGINFO |
| 1757 | SIGACTMASK(SIGINFO, siginfo_handler); |
| 1758 | #endif |
| 1759 | #ifdef SIGVTALRM |
| 1760 | SIGACTMASK(SIGVTALRM, siginfo_handler); |
| 1761 | #endif |
| 1762 | |
| 1763 | starttime = time(NULL); |
| 1764 | our_uid = MY_UID(); |
| 1765 | our_gid = MY_GID(); |
| 1766 | am_root = our_uid == ROOT_UID; |
| 1767 | |
| 1768 | // DISPLAY should not be emptied unconditionally |
| 1769 | if (!getenv("SSH_ASKPASS")) |
| 1770 | unset_env_var("DISPLAY"); |
| 1771 | |
| 1772 | #if defined USE_OPENSSL && defined SET_OPENSSL_CONF |
| 1773 | #define TO_STR2(x) #x |
| 1774 | #define TO_STR(x) TO_STR2(x) |
| 1775 | /* ./configure --with-openssl-conf=/etc/ssl/openssl-rsync.cnf |
| 1776 | * defines SET_OPENSSL_CONF as that unquoted pathname. */ |
| 1777 | if (!getenv("OPENSSL_CONF")) /* Don't override it if it's already set. */ |
| 1778 | set_env_str("OPENSSL_CONF", TO_STR(SET_OPENSSL_CONF)); |
| 1779 | #undef TO_STR |
| 1780 | #undef TO_STR2 |
| 1781 | #endif |
| 1782 | |
| 1783 | memset(&stats, 0, sizeof(stats)); |
| 1784 | |
| 1785 | /* Even a non-daemon runs needs the default config values to be set, e.g. |
| 1786 | * lp_dont_compress() is queried when no --skip-compress option is set. */ |
| 1787 | reset_daemon_vars(); |
| 1788 | |
| 1789 | if (argc < 2) { |
nothing calls this directly
no test coverage detected