FreeCalypso > hg > themwi-system-sw
comparison mncc/mtsock.c @ 25:fd43f179ff1d
themwi-mncc: need to initialize sa_len before accept call
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Tue, 28 Jun 2022 18:47:56 -0800 |
| parents | ccc5ab6d8388 |
| children | 660126bd5f59 |
comparison
equal
deleted
inserted
replaced
| 24:52e801b5ebb1 | 25:fd43f179ff1d |
|---|---|
| 54 struct sockaddr_un sa; | 54 struct sockaddr_un sa; |
| 55 socklen_t sa_len; | 55 socklen_t sa_len; |
| 56 int fd; | 56 int fd; |
| 57 struct socket_conn *conn; | 57 struct socket_conn *conn; |
| 58 | 58 |
| 59 sa_len = sizeof sa; | |
| 59 fd = accept(mtcall_listener, (struct sockaddr *) &sa, &sa_len); | 60 fd = accept(mtcall_listener, (struct sockaddr *) &sa, &sa_len); |
| 60 if (fd < 0) { | 61 if (fd < 0) { |
| 61 syslog(LOG_CRIT, "accept on UNIX socket: %m"); | 62 syslog(LOG_CRIT, "accept on UNIX socket: %m"); |
| 62 exit(1); | 63 exit(1); |
| 63 } | 64 } |
