struct timespec *, void *);
#endif
-/* Work around GCC 4.7.0 bug with strict overflow checking; see
+/* Work around GCC 4.3.0 bug with strict overflow checking; see
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52904>.
This bug appears to be fixed in GCC 5.1, so don't work around it there. */
-#if __GNUC__ == 4 && __GNUC_MINOR__ >= 3
+#if GNUC_PREREQ (4, 3, 0) && ! GNUC_PREREQ (5, 1, 0)
# pragma GCC diagnostic ignored "-Wstrict-overflow"
#endif
\f
and store them individually through the three pointers. */
static void
-decode_status (Lisp_Object l, Lisp_Object *symbol, int *code, bool *coredump)
+decode_status (Lisp_Object l, Lisp_Object *symbol, Lisp_Object *code,
+ bool *coredump)
{
Lisp_Object tem;
if (SYMBOLP (l))
{
*symbol = l;
- *code = 0;
+ *code = make_number (0);
*coredump = 0;
}
else
{
*symbol = XCAR (l);
tem = XCDR (l);
- *code = XFASTINT (XCAR (tem));
+ *code = XCAR (tem);
tem = XCDR (tem);
*coredump = !NILP (tem);
}
status_message (struct Lisp_Process *p)
{
Lisp_Object status = p->status;
- Lisp_Object symbol;
- int code;
+ Lisp_Object symbol, code;
bool coredump;
Lisp_Object string;
{
char const *signame;
synchronize_system_messages_locale ();
- signame = strsignal (code);
+ signame = strsignal (XFASTINT (code));
if (signame == 0)
string = build_string ("unknown");
else
else if (EQ (symbol, Qexit))
{
if (NETCONN1_P (p))
- return build_string (code == 0 ? "deleted\n" : "connection broken by remote peer\n");
- if (code == 0)
+ return build_string (XFASTINT (code) == 0
+ ? "deleted\n"
+ : "connection broken by remote peer\n");
+ if (XFASTINT (code) == 0)
return build_string ("finished\n");
AUTO_STRING (prefix, "exited abnormally with code ");
- string = Fnumber_to_string (make_number (code));
+ string = Fnumber_to_string (code);
AUTO_STRING (suffix, coredump ? " (core dumped)\n" : "\n");
return concat3 (prefix, string, suffix);
}
else if (EQ (symbol, Qfailed))
{
- AUTO_STRING (prefix, "failed with code ");
- string = Fnumber_to_string (make_number (code));
- AUTO_STRING (suffix, "\n");
- return concat3 (prefix, string, suffix);
+ AUTO_STRING (format, "failed with code %s\n");
+ return CALLN (Fformat, format, code);
}
else
return Fcopy_sequence (Fsymbol_name (symbol));
p = XPROCESS (proc);
-#ifdef GNU_LINUX
- /* getsockopt(,,SO_ERROR,,) is said to hang on some systems.
- So only use it on systems where it is known to work. */
+#ifndef WINDOWSNT
{
socklen_t xlen = sizeof (xerrno);
if (getsockopt (channel, SOL_SOCKET, SO_ERROR, &xerrno, &xlen))
xerrno = errno;
}
#else
+ /* On MS-Windows, getsockopt clears the error for the
+ entire process, which may not be the right thing; see
+ w32.c. Use getpeername instead. */
{
struct sockaddr pname;
socklen_t pnamelen = sizeof (pname);