On Tue, 3 Apr 2007 11:25:23 +0200 Stefan Seyfried <[EMAIL PROTECTED]> wrote:
> Hi,
>
> This is a RFC, i am not sure if printing the program name in all error
> messages is really useful, or if just "suspend:" is better there, but
> at least in usage() it should be the correct one.
I think I would vote for not printing the program name at all in the
informational messages, only in the error messages. But I haven't given
it much thought and really don't care much;) If we do want to print
something there, I do want to have the argv[0] there, not suspend, else
it would be a bit confusing.
A few small points:
Maybe you can fix the message on line suspend.c:187 too?
> Index: suspend.c
> ===================================================================
> RCS file: /cvsroot/suspend/suspend/suspend.c,v
> retrieving revision 1.73
> diff -u -p -r1.73 suspend.c
> --- suspend.c 1 Apr 2007 22:03:29 -0000 1.73
> +++ suspend.c 2 Apr 2007 16:14:53 -0000
> @@ -51,7 +51,7 @@
>
> #define suspend_error(msg, args...) \
> do { \
> - fprintf(stderr, "suspend: " msg " Reason: %m\n", ## args); \
> + fprintf(stderr, "%s: " msg " Reason: %m\n", my_name, ## args); \
> } while (0);
What is this do { } while (0); thing good for?
> @@ -733,8 +734,8 @@ static void suspend_shutdown(int snapsho
> } else if (use_platform_suspend) {
> int ret = platform_enter(snapshot_fd);
> if (ret < 0)
> - fprintf(stderr, "suspend: pm_ops->enter returned"
> - " error %d, calling power_off\n", errno);
> + fprintf(stderr, "%s: pm_ops->enter returned error "
> + "%d, calling power_off\n", my_name, errno);
> }
Can't you use the suspend_error macro here?
>
> @@ -773,13 +774,13 @@ int suspend_system(int snapshot_fd, int
> if (use_platform_suspend) {
> int ret = platform_prepare(snapshot_fd);
> if (ret < 0) {
> - fprintf(stderr, "suspend: pm_ops->prepare returned "
> - "error %d\n", errno);
> + fprintf(stderr, "%s: pm_ops->prepare returned error "
> + "%d\n", my_name, errno);
> use_platform_suspend = 0;
> }
> }
And here?
signature.asc
Description: PGP signature
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Suspend-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/suspend-devel
