X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/0f78b81511be65d8fe21af1e6ac674f9e80ac29d..cb15269eb0cb5580169e63fada0c71f168879f4f:/log.c diff --git a/log.c b/log.c index db212300..7fd37e42 100644 --- a/log.c +++ b/log.c @@ -15,9 +15,9 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #include "rsync.h" @@ -154,17 +154,14 @@ static void logfile_open(void) void log_init(void) { - time_t t; - if (log_initialised) return; log_initialised = 1; - /* this looks pointless, but it is needed in order for the + /* This looks pointless, but it is needed in order for the * C library on some systems to fetch the timezone info - * before the chroot */ - t = time(NULL); - localtime(&t); + * before the chroot. */ + timestring(time(NULL)); /* optionally use a log file instead of syslog */ logfname = lp_log_file(); @@ -259,7 +256,7 @@ void rwrite(enum logcode code, char *buf, int len) if (am_server) { /* Pass the message to the non-server side. */ - if (io_multiplex_write((enum msgcode)code, buf, len)) + if (send_msg((enum msgcode)code, buf, len)) return; if (am_daemon) { /* TODO: can we send the error to the user somehow? */