From: Dario Faggioli <dario.faggioli@citrix.com>
To: Harmandeep Kaur <write.harmandeep@gmail.com>,
xen-devel@lists.xenproject.org
Cc: wei.liu2@citrix.com, ian.jackson@eu.citrix.com,
ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH 3/9] xl: Improve return and exit codes of migrate related functions.
Date: Wed, 2 Mar 2016 18:53:44 +0100 [thread overview]
Message-ID: <1456941224.2959.392.camel@citrix.com> (raw)
In-Reply-To: <1456318407-3635-4-git-send-email-write.harmandeep@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 2536 bytes --]
On Wed, 2016-02-24 at 18:23 +0530, Harmandeep Kaur wrote:
> @@ -50,7 +50,7 @@
> else if (chk_errnoval > 0)
> { \
> fprintf(stderr,"xl: fatal error: %s:%d: %s:
> %s\n", \
> __FILE__,__LINE__, strerror(chk_errnoval),
> #call); \
> - exit(-
> ERROR_FAIL); \
> + exit(EXIT_FAILURE);
> \
> }
> \
> })
>
Right below this, there are two more macros, CHK_SYSCALL and MUST,
which also need "fixing"
> @@ -4152,7 +4152,7 @@ static pid_t create_migration_child(const char
> *rune, int *send_fd,
> pid_t child;
>
> if (!rune || !send_fd || !recv_fd)
> - return -1;
> + return EXIT_FAILURE;
>
Err.. no, create_migration_child() is an internal function, so it is ok
for it to return -1/0, isn't it?
>
> MUST( libxl_pipe(ctx, sendpipe) );
> MUST( libxl_pipe(ctx, recvpipe) );
> @@ -4166,7 +4166,7 @@ static pid_t create_migration_child(const char
> *rune, int *send_fd,
> close(recvpipe[0]); close(recvpipe[1]);
> execlp("sh","sh","-c",rune,(char*)0);
> perror("failed to exec sh");
> - exit(-1);
> + exit(EXIT_FAILURE);
> }
Of course, in this specific case, since it's an exit() and not a
'return', it is ok to convert this to EXIT_FAILURE, like you're doing.
> @@ -4189,16 +4189,16 @@ static int migrate_read_fixedmessage(int fd,
> const void *msg, int msgsz,
>
> stream = rune ? "migration receiver stream" : "migration
> stream";
> rc = libxl_read_exactly(ctx, fd, buf, msgsz, stream, what);
> - if (rc) return ERROR_FAIL;
> + if (rc) return EXIT_FAILURE;
>
Internal too, so ok changing it, but to -1/0.
Thanks and Regards,
Dario
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-03-02 17:53 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-24 12:53 [PATCH 0/9] xl: convert exit codes related to domain subcommands to EXIT_[SUCCESS|FAILURE] Harmandeep Kaur
2016-02-24 12:53 ` [PATCH 1/9] xl: Improve return and exit codes of memory related functions Harmandeep Kaur
2016-02-24 13:55 ` Olaf Hering
2016-02-24 14:30 ` Dario Faggioli
2016-02-25 11:10 ` Dario Faggioli
2016-02-24 12:53 ` [PATCH 2/9] xl: Improve return and exit codes of restore and save " Harmandeep Kaur
2016-03-02 18:02 ` Dario Faggioli
2016-02-24 12:53 ` [PATCH 3/9] xl: Improve return and exit codes of migrate " Harmandeep Kaur
2016-03-02 17:53 ` Dario Faggioli [this message]
2016-02-24 12:53 ` [PATCH 4/9] xl: Improve return and exit codes of main_console(), main_vncviewer() and main_dump_core() Harmandeep Kaur
2016-02-25 11:33 ` Dario Faggioli
[not found] ` <CAPtdW15OwR5WmAnyr9+KqEbTFsPwX2d9_CzS945gzoLQyPBtOA@mail.gmail.com>
2016-03-08 14:16 ` Dario Faggioli
2016-02-24 12:53 ` [PATCH 5/9] xl: Improve return and exit codes of main_pause(), main_unpause(), main_destroy() and main_shutdown_or_reboot() related functions Harmandeep Kaur
2016-03-02 16:59 ` Dario Faggioli
2016-02-24 12:53 ` [PATCH 6/9] xl: Improve return and exit codes of main_list() and main_vm_list() " Harmandeep Kaur
2016-03-02 17:37 ` Dario Faggioli
2016-02-24 12:53 ` [PATCH 7/9] xl: Improve return and exit codes of main_create(), main_config_update(), main_sharing(), main_rename() and " Harmandeep Kaur
2016-03-02 17:29 ` Dario Faggioli
2016-02-24 12:53 ` [PATCH 8/9] xl: Improve return and exit codes main_button_press(), main_trigger(), main_remus() " Harmandeep Kaur
2016-02-25 11:26 ` Dario Faggioli
2016-02-24 12:53 ` [PATCH 9/9] xl: Improve return codes of main_domid(), main_domname() and main_sysrq() " Harmandeep Kaur
2016-02-25 11:18 ` Dario Faggioli
2016-02-25 10:57 ` [PATCH 0/9] xl: convert exit codes related to domain subcommands to EXIT_[SUCCESS|FAILURE] Dario Faggioli
2016-03-02 18:05 ` Dario Faggioli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1456941224.2959.392.camel@citrix.com \
--to=dario.faggioli@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=write.harmandeep@gmail.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).