summaryrefslogtreecommitdiff
path: root/src/libnsss/nsss_switch_shadow_get.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2021-09-02 16:46:41 +0000
committerLaurent Bercot <ska@appnovation.com>2021-09-02 16:46:41 +0000
commit1f213b642deb1d8e6139d2b7daac8f639c8717e7 (patch)
tree09c938120a9be6a97ec6c52b082316d7a3143db9 /src/libnsss/nsss_switch_shadow_get.c
parentc9a58ceb7c07774944930105ace2f042be7b5f53 (diff)
downloadnsss-1f213b642deb1d8e6139d2b7daac8f639c8717e7.tar.xz
Pass errno as unsigned char
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libnsss/nsss_switch_shadow_get.c')
-rw-r--r--src/libnsss/nsss_switch_shadow_get.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libnsss/nsss_switch_shadow_get.c b/src/libnsss/nsss_switch_shadow_get.c
index 27b1e70..a2fc431 100644
--- a/src/libnsss/nsss_switch_shadow_get.c
+++ b/src/libnsss/nsss_switch_shadow_get.c
@@ -8,10 +8,10 @@
int nsss_switch_shadow_get (nsss_switch_t *a, struct spwd *sp, stralloc *sa, tain const *deadline, tain *stamp)
{
- char c = NSSS_SWITCH_SHADOW_GET ;
- if (!ipc_timed_send(buffer_fd(&a->b), &c, 1, deadline, stamp)) return 0 ;
- if (!buffer_timed_get(&a->b, &c, 1, deadline, stamp)) return 0 ;
- if ((unsigned char)c == 255) return 0 ;
+ unsigned char c = NSSS_SWITCH_SHADOW_GET ;
+ if (!ipc_timed_send(buffer_fd(&a->b), (char *)&c, 1, deadline, stamp)) return 0 ;
+ if (!buffer_timed_get(&a->b, (char *)&c, 1, deadline, stamp)) return 0 ;
+ if (c == 255) return 0 ;
if (c) return (errno = c, 0) ;
return nsss_switch_shadow_read(&a->b, sp, sa, deadline, stamp) ;
}