Util-Linux package development
 help / color / mirror / Atom feed
* question about hardcoded binary paths (swapon / mkswap)
@ 2015-04-01 11:42 Ruediger Meier
  2015-04-01 13:38 ` Isaac Dunham
  0 siblings, 1 reply; 16+ messages in thread
From: Ruediger Meier @ 2015-04-01 11:42 UTC (permalink / raw)
  To: util-linux

Hi,

I wonder about some hardcoded binary paths.

Example swapon.c:

#define PATH_MKSWAP    "/sbin/mkswap"

There are a two problems.
1. It's wrong. We should use $sbindir from configure.
2. When called from our test-suite it will use a wrong (or
   non-existend, broken) binary. This happens in test swapon/fixpgsz.

The question is how to fix this.

I would prefer to use "mkwsap" from the same directory like swapon or to 
simply execvp "mkswap" from PATH. But don't know if we want this. If we 
really want to keep a hardcoded sbindir then we would need "#ifdef 
TEST_PROGRAM".

Any comments?

cu,
Rudi

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-04-03 23:16 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-01 11:42 question about hardcoded binary paths (swapon / mkswap) Ruediger Meier
2015-04-01 13:38 ` Isaac Dunham
2015-04-01 16:17   ` Ruediger Meier
2015-04-01 20:10     ` Mike Frysinger
2015-04-01 21:06       ` Ruediger Meier
2015-04-01 21:38         ` Karel Zak
2015-04-02  1:12           ` Mike Frysinger
2015-04-02  8:20             ` Karel Zak
2015-04-02 16:19               ` Mike Frysinger
2015-04-02 19:15                 ` Karel Zak
2015-04-02 22:50                   ` Ruediger Meier
2015-04-03  1:15                   ` Mike Frysinger
2015-04-03  8:52                     ` Karel Zak
2015-04-03 23:16                       ` Mike Frysinger
2015-04-02 17:28               ` Isaac Dunham
2015-04-01 22:23         ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox