Skip to content

Commit

Permalink
avoid duplicate basename(3) calls
Browse files Browse the repository at this point in the history
Problem: log_init() already calls basename(3) on its argument
but some users do another one.

Drop extra basename.
  • Loading branch information
garlick committed Dec 4, 2024
1 parent fb7bea1 commit 10cf00a
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion t/kvs/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ int main (int argc, char *argv[])
tstat_t ts;
struct timespec t0;

log_init (basename (argv[0]));
log_init (argv[0]);

while ((ch = getopt_long (argc, argv, OPTIONS, longopts, NULL)) != -1) {
switch (ch) {
Expand Down
2 changes: 1 addition & 1 deletion t/kvs/fence_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ int main (int argc, char *argv[])
thd_t *thd;
int i, ch, num, rc;

log_init (basename (argv[0]));
log_init (argv[0]);

while ((ch = getopt_long (argc, argv, OPTIONS, longopts, NULL)) != -1) {
switch (ch) {
Expand Down
2 changes: 1 addition & 1 deletion t/kvs/fence_invalid.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ int main (int argc, char *argv[])
flux_kvs_txn_t *txn1 = NULL;
flux_kvs_txn_t *txn2 = NULL;

log_init (basename (argv[0]));
log_init (argv[0]);

if (argc != 2)
usage ();
Expand Down
2 changes: 1 addition & 1 deletion t/kvs/fence_namespace_remove.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int main (int argc, char *argv[])
flux_future_t *f = NULL;
flux_kvs_txn_t *txn = NULL;

log_init (basename (argv[0]));
log_init (argv[0]);

if (argc != 3)
usage ();
Expand Down
2 changes: 1 addition & 1 deletion t/kvs/lookup_invalid.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int main (int argc, char *argv[])
char *key = NULL;
flux_future_t *f = NULL;

log_init (basename (argv[0]));
log_init (argv[0]);

if (argc != 2)
usage ();
Expand Down
2 changes: 1 addition & 1 deletion t/kvs/transactionmerge.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ int main (int argc, char *argv[])
flux_reactor_t *r;
int i, rc, ch;

log_init (basename (argv[0]));
log_init (argv[0]);

while ((ch = getopt_long (argc, argv, OPTIONS, longopts, NULL)) != -1) {
switch (ch) {
Expand Down

0 comments on commit 10cf00a

Please sign in to comment.