* [PATCH] wdctl: align with other util-linux commands
@ 2012-04-19 19:10 Sami Kerola
2012-05-02 17:37 ` Sami Kerola
0 siblings, 1 reply; 3+ messages in thread
From: Sami Kerola @ 2012-04-19 19:10 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
* Add watchdog device path to pathnames.h
* Check output stream status at exit.
* Adjust usage() notation to follow howto file.
* Retire numeric return value.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
include/pathnames.h | 2 ++
sys-utils/wdctl.c | 10 +++++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/include/pathnames.h b/include/pathnames.h
index 88bec08..ba8de01 100644
--- a/include/pathnames.h
+++ b/include/pathnames.h
@@ -146,6 +146,8 @@
/* deprecated */
#define _PATH_RAWDEVCTL_OLD "/dev/rawctl"
+/* wdctl path */
+#define _PATH_WATCHDOG_DEV "/dev/watchdog"
#endif /* PATHNAMES_H */
diff --git a/sys-utils/wdctl.c b/sys-utils/wdctl.c
index 179aff2..4c6f874 100644
--- a/sys-utils/wdctl.c
+++ b/sys-utils/wdctl.c
@@ -28,6 +28,8 @@
#include "nls.h"
#include "c.h"
+#include "closestream.h"
+#include "pathnames.h"
static const struct {
uint32_t flag;
@@ -55,7 +57,8 @@ static void usage(int status)
_(" %s [options]\n"), program_invocation_short_name);
fputs(USAGE_OPTIONS, out);
- fputs(_(" -d, --device= device to use (/dev/watchdog)\n"), out);
+ fprintf(out,
+ _(" -d, --device <path> device to use (default is %s)\n"), _PATH_WATCHDOG_DEV);
fputs(USAGE_SEPARATOR, out);
fputs(USAGE_HELP, out);
@@ -94,12 +97,13 @@ int main(int argc, char *argv[])
};
int c, status, sec, fd;
- const char *device = "/dev/watchdog";
+ const char *device = _PATH_WATCHDOG_DEV;
struct watchdog_info ident;
setlocale(LC_MESSAGES, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while((c = getopt_long(argc, argv, "hVd:", longopts, NULL)) != -1) {
@@ -176,5 +180,5 @@ int main(int argc, char *argv[])
close(fd);
- return 0;
+ return EXIT_SUCCESS;
}
--
1.7.10
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] wdctl: align with other util-linux commands
2012-04-19 19:10 [PATCH] wdctl: align with other util-linux commands Sami Kerola
@ 2012-05-02 17:37 ` Sami Kerola
2012-05-03 6:39 ` Karel Zak
0 siblings, 1 reply; 3+ messages in thread
From: Sami Kerola @ 2012-05-02 17:37 UTC (permalink / raw)
To: util-linux
On Thu, Apr 19, 2012 at 9:10 PM, Sami Kerola <kerolasa@iki.fi> wrote:
> * Add watchdog device path to pathnames.h
> * Check output stream status at exit.
> * Adjust usage() notation to follow howto file.
> * Retire numeric return value.
>
> include/pathnames.h | 2 ++
> sys-utils/wdctl.c | 10 +++++++---
> 2 files changed, 9 insertions(+), 3 deletions(-)
Hi Karel,
It's been while since I sent this to review. Perhaps it is soon time
to accept or reject the patch.
--
Sami Kerola
http://www.iki.fi/kerolasa/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] wdctl: align with other util-linux commands
2012-05-02 17:37 ` Sami Kerola
@ 2012-05-03 6:39 ` Karel Zak
0 siblings, 0 replies; 3+ messages in thread
From: Karel Zak @ 2012-05-03 6:39 UTC (permalink / raw)
To: kerolasa; +Cc: util-linux
On Wed, May 02, 2012 at 07:37:55PM +0200, Sami Kerola wrote:
> On Thu, Apr 19, 2012 at 9:10 PM, Sami Kerola <kerolasa@iki.fi> wrote:
> > * Add watchdog device path to pathnames.h
> > * Check output stream status at exit.
> > * Adjust usage() notation to follow howto file.
> > * Retire numeric return value.
> >
> > include/pathnames.h | 2 ++
> > sys-utils/wdctl.c | 10 +++++++---
> > 2 files changed, 9 insertions(+), 3 deletions(-)
>
> Hi Karel,
>
> It's been while since I sent this to review. Perhaps it is soon time
> to accept or reject the patch.
Good timing, I'm just working on the code ;-)
Sorry for the delay, your changes seems correct, but I'd like to a
little rewrite the original Lennart's code to to make it more
compatible with our new utils (like lsblk, lslocks, ...).
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-05-03 6:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-19 19:10 [PATCH] wdctl: align with other util-linux commands Sami Kerola
2012-05-02 17:37 ` Sami Kerola
2012-05-03 6:39 ` Karel Zak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox