mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-27 03:42:49 +00:00
Fix compilation on platforms without SO_PASSCRED
This commit is contained in:
parent
6807f4d4ea
commit
fafb8518e0
1 changed files with 5 additions and 0 deletions
|
|
@ -1801,6 +1801,10 @@ send_data_to_peer(PyObject *self UNUSED, PyObject *args) {
|
|||
|
||||
static PyObject *
|
||||
random_unix_socket(PyObject *self UNUSED, PyObject *args UNUSED) {
|
||||
#ifndef SO_PASSCRED
|
||||
errno = ENOTSUP;
|
||||
return PyErr_SetFromErrno(PyExc_OSError);
|
||||
#else
|
||||
int fd, optval = 1;
|
||||
struct sockaddr_un bind_addr = {.sun_family=AF_UNIX};
|
||||
fd = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
|
|
@ -1811,6 +1815,7 @@ random_unix_socket(PyObject *self UNUSED, PyObject *args UNUSED) {
|
|||
fail:
|
||||
safe_close(fd, __FILE__, __LINE__);
|
||||
return PyErr_SetFromErrno(PyExc_OSError);
|
||||
#endif
|
||||
}
|
||||
|
||||
static PyMethodDef module_methods[] = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue