Skip to content

Commit f42521d

Browse files
committed
Rip out unused fork_and_flush_buffer()
It's never called.
1 parent 2901f00 commit f42521d

File tree

2 files changed

+0
-28
lines changed

2 files changed

+0
-28
lines changed

libqrexec/libqrexec-utils.h

-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ void *buffer_data(struct buffer *b);
124124

125125
int flush_client_data(int fd, struct buffer *buffer);
126126
int write_stdin(int fd, const char *data, int len, struct buffer *buffer);
127-
int fork_and_flush_stdin(int fd, struct buffer *buffer);
128127

129128
/**
130129
* @brief Execute an already-parsed Qubes RPC command.

libqrexec/write-stdin.c

-27
Original file line numberDiff line numberDiff line change
@@ -90,30 +90,3 @@ int write_stdin(int fd, const char *data, int len, struct buffer *buffer)
9090
}
9191
return WRITE_STDIN_OK;
9292
}
93-
94-
/*
95-
* Data feed process has exited, so we need to clear all control structures for
96-
* the client. However, if we have buffered data for the client (which is rare btw),
97-
* fire&forget a separate process to flush them.
98-
*/
99-
int fork_and_flush_stdin(int fd, struct buffer *buffer)
100-
{
101-
int i;
102-
if (!buffer_len(buffer))
103-
return 0;
104-
switch (fork()) {
105-
case -1:
106-
PERROR("fork");
107-
exit(1);
108-
case 0:
109-
break;
110-
default:
111-
return 1;
112-
}
113-
for (i = 0; i < MAX_FDS; i++)
114-
if (i != fd && i != 2)
115-
close(i);
116-
set_block(fd);
117-
write_all(fd, buffer_data(buffer), buffer_len(buffer));
118-
_exit(0);
119-
}

0 commit comments

Comments
 (0)