diff options
author | Christian Hesse <mail@eworm.de> | 2016-05-28 23:44:42 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2016-05-28 23:44:42 +0200 |
commit | 19e29ad6f256d80bfdd7e4b824eada603a00e49a (patch) | |
tree | 358bafe91e4e895516a50c3aa319e88deaea7fe7 /udev/ykfde.c | |
parent | ca67c46edf1c0543ce58bd075c565e1cb9a5a926 (diff) | |
download | mkinitcpio-ykfde-19e29ad6f256d80bfdd7e4b824eada603a00e49a.tar.gz mkinitcpio-ykfde-19e29ad6f256d80bfdd7e4b824eada603a00e49a.tar.zst |
indent with tabs
Diffstat (limited to 'udev/ykfde.c')
-rw-r--r-- | udev/ykfde.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/udev/ykfde.c b/udev/ykfde.c index c95237d..af08104 100644 --- a/udev/ykfde.c +++ b/udev/ykfde.c @@ -60,21 +60,21 @@ void received_signal(int signal) { } static int send_on_socket(int fd, const char *socket_name, const void *packet, size_t size) { - union { - struct sockaddr sa; - struct sockaddr_un un; - } sa = { - .un.sun_family = AF_UNIX, - }; - - strncpy(sa.un.sun_path, socket_name, sizeof(sa.un.sun_path)); - - if (sendto(fd, packet, size, MSG_NOSIGNAL, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(socket_name)) < 0) { - perror("sendto() failed"); - return EXIT_FAILURE; - } + union { + struct sockaddr sa; + struct sockaddr_un un; + } sa = { + .un.sun_family = AF_UNIX, + }; + + strncpy(sa.un.sun_path, socket_name, sizeof(sa.un.sun_path)); + + if (sendto(fd, packet, size, MSG_NOSIGNAL, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(socket_name)) < 0) { + perror("sendto() failed"); + return EXIT_FAILURE; + } - return EXIT_SUCCESS; + return EXIT_SUCCESS; } static int try_answer(YK_KEY * yk, uint8_t slot, const char * ask_file, char * challenge) { @@ -192,7 +192,7 @@ int main(int argc, char **argv) { /* read challenge */ char challenge[CHALLENGELEN + 1]; char challengefilename[sizeof(CHALLENGEDIR) + 11 /* "/challenge-" */ + 10 /* unsigned int in char */ + 1]; - int challengefile; + int challengefile; /* read dir */ DIR * dir; struct dirent * ent; |