Skip to content

Commit c9125b8

Browse files
authored
get rid of warnings (#2)
As a PR so we can review later in case we needed some of the return values after all.
1 parent a5b7e5c commit c9125b8

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

libSegFault/alpha/register-dump.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ static void register_dump(int fd, struct ucontext_t *ctx)
229229
ADD_STRING("\n");
230230

231231
/* Write the stuff out. */
232-
writev(fd, iov, nr);
232+
ssize_t c = writev(fd, iov, nr);
233233
}
234234

235235
#define REGISTER_DUMP register_dump(fd, ctx)

libSegFault/signal-safe-trace.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,29 +57,34 @@ void do_signal_safe_trace()
5757
{
5858
cpptrace::frame_ptr buffer[100];
5959
std::size_t count = cpptrace::safe_generate_raw_trace(buffer, 100);
60+
6061
pipe_t input_pipe;
61-
pipe(input_pipe.data);
62+
std::ignore = pipe(input_pipe.data);
63+
6264
const pid_t pid = fork();
6365
if (pid == -1)
6466
{
65-
write(STDERR_FILENO, fork_failure_message.data(), fork_failure_message.size());
67+
std::ignore = write(STDERR_FILENO, fork_failure_message.data(), fork_failure_message.size());
6668
return;
6769
}
70+
6871
if (pid == 0)
6972
{ // child
7073
dup2(input_pipe.read_end, STDIN_FILENO);
7174
close(input_pipe.read_end);
7275
close(input_pipe.write_end);
7376
execl(tracer_program.c_str(), tracer_program.c_str(), nullptr);
74-
write(STDERR_FILENO, exec_failure_message.data(), exec_failure_message.size());
77+
std::ignore = write(STDERR_FILENO, exec_failure_message.data(), exec_failure_message.size());
7578
_exit(1);
7679
}
80+
7781
for (std::size_t i = 0; i < count; i++)
7882
{
7983
cpptrace::safe_object_frame frame;
8084
cpptrace::get_safe_object_frame(buffer[i], &frame);
81-
write(input_pipe.write_end, &frame, sizeof(frame));
85+
std::ignore = write(input_pipe.write_end, &frame, sizeof(frame));
8286
}
87+
8388
close(input_pipe.read_end);
8489
close(input_pipe.write_end);
8590
waitpid(pid, nullptr, 0);

libSegFault/x86_64/register-dump.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ static void register_dump(int fd, ucontext_t *ctx)
315315
ADD_STRING("\n");
316316

317317
/* Write the stuff out. */
318-
writev(fd, iov, nr);
318+
ssize_t c = writev(fd, iov, nr);
319319
}
320320

321321

0 commit comments

Comments
 (0)