Permalink
Browse files

Make the -a cmdline flag actually work.

If specified, -a says what file to open as the unix socket.
  • Loading branch information...
1 parent 0308855 commit 3ec4438ea3364cd12d0f6488763fbc6e4c39a647 Kirsten Peryer committed Aug 28, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 charade.c
View
@@ -135,8 +135,14 @@ create_socket(void)
remove_socket_at_exit = 1;
- int ret = snprintf(socket_name, sizeof(socket_name),
+ int ret;
+ if (g_socket_name) {
+ ret = snprintf(socket_name, sizeof(socket_name),
+ "%s", g_socket_name);
+ } else {
+ ret = snprintf(socket_name, sizeof(socket_name),
"%s/agent.%ld", socket_dir, (long)getpid());
+ }
if (ret >= sizeof(socket_name)) {
// Would have liked to print more...
EPRINTF(0, "socket_name too long (%d >= %d).\n",

0 comments on commit 3ec4438

Please sign in to comment.