Author SHA1 Message Date
Guido Günther da7a3742ab rpcd: Map -h to help
This allows to get usage information without a non-zero exit status.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2026-09-15 10:21:41 +02:00
2 changed files with 13 additions and 2 deletions

No files matched your search

+5
View File
@@ -4,6 +4,8 @@
hexagonrpcd - Server for FastRPC remote procedure calls from Qualcomm DSPs
.SH SYNOPSIS
\fBhexagonrpcd\fP [\fIoptions\&.\&.\&.\fP] -f \fIDEVICE
.PP
\fBhexagonrpcd\fP -h
.SH DESCRIPTION
Server for FastRPC remote procedure calls from Qualcomm DSPs\&.
.PP
@@ -25,6 +27,9 @@ Root directory of served files (default: /usr/share/qcom/)
.TP
\fB\-s\fP
Attach to sensorspd
.TP
\fB\-h\fP
Print help and exit
.PP
.SH NOTES
+8 -2
View File
@@ -77,7 +77,8 @@ static void print_usage(const char *argv0)
"\t-f DEVICE\tFastRPC device node to attach to\n"
"\t-p PROGRAM\tRun client program with shared file descriptor\n"
"\t-R DIR\t\tRoot directory of served files (default: /usr/share/qcom/)\n"
"\t-s\t\tAttach to sensorspd\n");
"\t-s\t\tAttach to sensorspd\n"
"\t-h\t\tPrint help and exit\n");
}
static int create_shell_pd(int fd, const char *create_shell)
@@ -372,7 +373,7 @@ int main(int argc, char* argv[])
if (guessed_device_dir != NULL)
device_dir = guessed_device_dir;
while ((opt = getopt(argc, argv, "c:d:f:p:R:s")) != -1) {
while ((opt = getopt(argc, argv, "c:d:f:p:R:sh")) != -1) {
switch (opt) {
case 'c':
create_shell = optarg;
@@ -393,6 +394,10 @@ int main(int argc, char* argv[])
case 's':
attach_sns = true;
break;
case 'h':
print_usage(argv[0]);
goto free_pids;
break;
default:
print_usage(argv[0]);
goto err_free_pids;
@@ -438,6 +443,7 @@ int main(int argc, char* argv[])
terminate_clients(n_progs, pids);
close(fd);
free_pids:
free(pids);
free(progs);