abduco

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

commit a1db9e2dae19d7969474e35a969ceb0800339a1f
parent 66a17ed03d2c44be5e5a80931e4f2bd5c363e090
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Tue, 27 Jun 2017 09:57:03 +0200

Check return value of chdir(2) where it makes sense

Diffstat:
abduco.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/abduco.c b/abduco.c @@ -544,7 +544,8 @@ static int session_comparator(const struct dirent **a, const struct dirent **b) static int list_session(void) { if (!create_socket_dir(&sockaddr)) return 1; - chdir(sockaddr.sun_path); + if (chdir(sockaddr.sun_path) == -1) + die("list-session"); struct dirent **namelist; int n = scandir(sockaddr.sun_path, &namelist, session_filter, session_comparator); if (n < 0)