diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2010-06-12 16:04:14 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2010-06-12 16:04:14 +0200 |
commit | ea75e69a3a4081fa9755b32b5e2b87037267fc90 (patch) | |
tree | ce2444ae508028a9992ad90d54313ecc40ff2a37 /src/ipc.c | |
parent | c74e415e9246382630035d7a85645a6b93e1efae (diff) |
Remove ipc.c/ipc.s, they seem to be used nowhere
Diffstat (limited to 'src/ipc.c')
-rw-r--r-- | src/ipc.c | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/src/ipc.c b/src/ipc.c deleted file mode 100644 index 5299404..0000000 --- a/src/ipc.c +++ /dev/null @@ -1,78 +0,0 @@ -/* ipc.c - -Copyright (C) 1999-2003 Tom Gilbert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies of the Software and its documentation and acknowledgment shall be -given in the documentation and software packages that this Software was -used. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -*/ - -#include "feh.h" -#include "debug.h" -#include "options.h" - -static int session_id = 0; -static char *socket_name; -static int socket_fd = 0; - -void feh_ipc_create_socket(void) -{ - struct sockaddr_un saddr; - int i; - - if ((socket_fd = socket(AF_UNIX, SOCK_STREAM, 0)) != -1) { - for (i = 0;; i++) { - saddr.sun_family = AF_UNIX; - snprintf(saddr.sun_path, 108, "%s/feh_%s.%d", feh_get_tmp_dir(), feh_get_user_name(), i); -/* - if (!feh_remote_is_running(i)) { - if ((unlink(saddr.sun_path) == -1) && errno != ENOENT) { - close(socket_fd); - eprintf("feh_ipc_create_socket: failed to unlink %s:", saddr.sun_path); - } - } else { - continue; - } -*/ - if (bind(socket_fd, (struct sockaddr *) &saddr, sizeof(saddr)) != -1) { - session_id = i; - socket_name = estrdup(saddr.sun_path); - listen(socket_fd, 50); - break; - } else { - close(socket_fd); - eprintf("feh_ipc_create_socket: failed to bind %s to a socket:", saddr.sun_path); - } - } - } else { - eprintf("feh_ipc_create_socket: failed to open socket:"); - } -} - -int feh_ipc_get_session_id(void) -{ - return session_id; -} - -void feh_ipc_cleanup(void) -{ - close(socket_fd); - unlink(socket_name); - free(socket_name); -} |