Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RevokeFS demo fixes #5458

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Next Next commit
revokefs: Fix up some messages
Some `g_print*` messages were missing newlines and `perror` already
appends `: ` to the provided message.
  • Loading branch information
dbnicholson committed Jun 28, 2023
commit 921deb35530e4b51e50b89d4a2dd9e8f91ce3d69
6 changes: 3 additions & 3 deletions revokefs/demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ main (int argc, char *argv[])
NULL, NULL,
&backend_pid, &error))
{
g_printerr ("Failed to launch backend: %s", error->message);
g_printerr ("Failed to launch backend: %s\n", error->message);
exit (EXIT_FAILURE);
}
close (sockets[0]); /* Close backend side now so it doesn't get into the fuse child */
Expand All @@ -69,7 +69,7 @@ main (int argc, char *argv[])
NULL, NULL,
&fuse_pid, &error))
{
g_printerr ("Failed to launch backend: %s", error->message);
g_printerr ("Failed to FUSE process: %s\n", error->message);
exit (EXIT_FAILURE);
}

Expand All @@ -79,6 +79,6 @@ main (int argc, char *argv[])
perror ("fgets");
}

g_print ("Revoking write permissions");
g_print ("Revoking write permissions\n");
shutdown (sockets[1], SHUT_RDWR);
}
2 changes: 1 addition & 1 deletion revokefs/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ main (int argc, char *argv[])
basefd = openat (AT_FDCWD, base_path, O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC | O_NOCTTY);
if (basefd == -1)
{
perror ("opening basepath: ");
perror ("opening basepath");
exit (EXIT_FAILURE);
}

Expand Down
16 changes: 8 additions & 8 deletions revokefs/writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,13 +794,13 @@ do_writer (int basefd_arg,
res = poll(pollfds, exit_with_fd >= 0 ? 2 : 1, -1);
if (res < 0)
{
perror ("Got error polling sockets: ");
perror ("Got error polling sockets");
exit (1);
}

if (exit_with_fd >= 0 && (pollfds[1].revents & (POLLERR|POLLHUP)) != 0)
{
g_printerr ("Received EOF on exit-with-fd argument");
g_printerr ("Received EOF on exit-with-fd argument\n");
exit (1);
}

Expand All @@ -810,7 +810,7 @@ do_writer (int basefd_arg,
size = TEMP_FAILURE_RETRY (read (fuse_socket, request_buffer, sizeof (request_buffer)));
if (size == -1)
{
perror ("Got error reading from fuse socket: ");
perror ("Got error reading from fuse socket");
exit (1);
}

Expand All @@ -822,7 +822,7 @@ do_writer (int basefd_arg,

if (size < sizeof (RevokefsRequest))
{
g_printerr ("Invalid request size %zd", size);
g_printerr ("Invalid request size %zd\n", size);
exit (1);
}

Expand Down Expand Up @@ -880,13 +880,13 @@ do_writer (int basefd_arg,
response_data_size = handle_access (request, data_size, response);
break;
default:
g_printerr ("Invalid request op %d", (guint) request->op);
g_printerr ("Invalid request op %d\n", (guint) request->op);
exit (1);
}

if (response_data_size < 0 || response_data_size > MAX_DATA_SIZE)
{
g_printerr ("Invalid response size %zd", response_data_size);
g_printerr ("Invalid response size %zd\n", response_data_size);
exit (1);
}

Expand All @@ -895,13 +895,13 @@ do_writer (int basefd_arg,
written_size = TEMP_FAILURE_RETRY (write (fuse_socket, response_buffer, response_size));
if (written_size == -1)
{
perror ("Got error writing to fuse socket: ");
perror ("Got error writing to fuse socket");
exit (1);
}

if (written_size != response_size)
{
g_printerr ("Got partial write to fuse socket");
g_printerr ("Got partial write to fuse socket\n");
exit (1);
}
}
Expand Down