From c694b9b417683f29ddf331ec5122df37a2766403 Mon Sep 17 00:00:00 2001 From: greatim Date: Wed, 21 Dec 2016 10:06:21 +0900 Subject: [PATCH] fix potential bugs fix NO_LOCK.STAT bugs for errno Change-Id: Ic24d17fdf755d9d7b007db68b50b6fb2b30cee37 Signed-off-by: greatim --- src/file_sync_service.c | 3 +-- src/transport.c | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/file_sync_service.c b/src/file_sync_service.c index 9377078..4dd0860 100644 --- a/src/file_sync_service.c +++ b/src/file_sync_service.c @@ -387,8 +387,7 @@ static int handle_send_file(int s, int noti_fd, char *path, mode_t mode, char *b sdb_close(fd); sdb_unlink(path); fd = -1; - errno = saved_errno; - if(fail_errno(s, errno)) return -1; + if(fail_errno(s, saved_errno)) return -1; } } diff --git a/src/transport.c b/src/transport.c index 616acab..7811628 100644 --- a/src/transport.c +++ b/src/transport.c @@ -242,9 +242,7 @@ void send_packet(apacket *p, atransport *t) if (t == NULL) { D("Transport is null \n"); - // Zap errno because print_packet() and other stuff have errno effect. - errno = 0; - fatal_errno("Transport is null"); + fatal("Transport is null"); } if(write_packet(t->transport_socket, t->serial, &p)){ -- 2.7.4