Lisp_Object symbol;
int code;
bool coredump;
- Lisp_Object string, string2;
+ Lisp_Object string;
decode_status (status, &symbol, &code, &coredump);
if (c1 != c2)
Faset (string, make_number (0), make_number (c2));
}
- string2 = build_local_string (coredump ? " (core dumped)\n" : "\n");
- return concat2 (string, string2);
+ AUTO_STRING (suffix, coredump ? " (core dumped)\n" : "\n");
+ return concat2 (string, suffix);
}
else if (EQ (symbol, Qexit))
{
return build_string (code == 0 ? "deleted\n" : "connection broken by remote peer\n");
if (code == 0)
return build_string ("finished\n");
+ AUTO_STRING (prefix, "exited abnormally with code ");
string = Fnumber_to_string (make_number (code));
- string2 = build_local_string (coredump ? " (core dumped)\n" : "\n");
- return concat3 (build_local_string ("exited abnormally with code "),
- string, string2);
+ 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));
- string2 = build_local_string ("\n");
- return concat3 (build_local_string ("failed with code "),
- string, string2);
+ AUTO_STRING (suffix, "\n");
+ return concat3 (prefix, string, suffix);
}
else
return Fcopy_sequence (Fsymbol_name (symbol));
ptrdiff_t size = p->header.size;
Lisp_Object args[10];
int nargs, i;
+ char const *format;
if (size == 4 || (size == 5 && !NILP (omit_port)))
{
- args[0] = build_local_string ("%d.%d.%d.%d");
+ format = "%d.%d.%d.%d";
nargs = 4;
}
else if (size == 5)
{
- args[0] = build_local_string ("%d.%d.%d.%d:%d");
+ format = "%d.%d.%d.%d:%d";
nargs = 5;
}
else if (size == 8 || (size == 9 && !NILP (omit_port)))
{
- args[0] = build_local_string ("%x:%x:%x:%x:%x:%x:%x:%x");
+ format = "%x:%x:%x:%x:%x:%x:%x:%x";
nargs = 8;
}
else if (size == 9)
{
- args[0] = build_local_string ("[%x:%x:%x:%x:%x:%x:%x:%x]:%d");
+ format = "[%x:%x:%x:%x:%x:%x:%x:%x]:%d";
nargs = 9;
}
else
return Qnil;
+ AUTO_STRING (format_obj, format);
+ args[0] = format_obj;
+
for (i = 0; i < nargs; i++)
{
if (! RANGED_INTEGERP (0, p->contents[i], 65535))
}
if (CONSP (address))
- return Fformat (2, ((Lisp_Object [])
- { build_local_string ("<Family %d>"), Fcar (address) }));
+ {
+ AUTO_STRING (format, "<Family %d>");
+ return Fformat (2, (Lisp_Object []) {format, Fcar (address)});
+ }
return Qnil;
}
address_un.sun_family = AF_LOCAL;
if (sizeof address_un.sun_path <= SBYTES (service))
error ("Service name too long");
- strcpy (address_un.sun_path, SSDATA (service));
+ lispstpcpy (address_un.sun_path, service);
ai.ai_addr = (struct sockaddr *) &address_un;
ai.ai_addrlen = sizeof address_un;
goto open_socket;
if (sizeof rq.ifr_name <= SBYTES (ifname))
error ("interface name too long");
- strcpy (rq.ifr_name, SSDATA (ifname));
+ lispstpcpy (rq.ifr_name, ifname);
s = socket (AF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
if (s < 0)
{
unsigned char *ip = (unsigned char *)&saddr.in.sin_addr.s_addr;
+ AUTO_STRING (ipv4_format, "%d.%d.%d.%d");
host = Fformat (5, ((Lisp_Object [])
- { build_local_string ("%d.%d.%d.%d"), make_number (ip[0]),
+ { ipv4_format, make_number (ip[0]),
make_number (ip[1]), make_number (ip[2]), make_number (ip[3]) }));
service = make_number (ntohs (saddr.in.sin_port));
- caller = Fformat (3, ((Lisp_Object [])
- { build_local_string (" <%s:%d>"), host, service }));
+ AUTO_STRING (caller_format, " <%s:%d>");
+ caller = Fformat (3, (Lisp_Object []) {caller_format, host, service});
}
break;
uint16_t *ip6 = (uint16_t *)&saddr.in6.sin6_addr;
int i;
- args[0] = build_local_string ("%x:%x:%x:%x:%x:%x:%x:%x");
+ AUTO_STRING (ipv6_format, "%x:%x:%x:%x:%x:%x:%x:%x");
+ args[0] = ipv6_format;
for (i = 0; i < 8; i++)
args[i + 1] = make_number (ntohs (ip6[i]));
host = Fformat (9, args);
service = make_number (ntohs (saddr.in.sin_port));
- caller = Fformat (3, ((Lisp_Object [])
- { build_local_string (" <[%s]:%d>"), host, service }));
+ AUTO_STRING (caller_format, " <[%s]:%d>");
+ caller = Fformat (3, (Lisp_Object []) {caller_format, host, service});
}
break;
#endif
#endif
default:
caller = Fnumber_to_string (make_number (connect_counter));
- caller = concat3
- (build_local_string (" <"), caller, build_local_string (">"));
+ AUTO_STRING (space_less_than, " <");
+ AUTO_STRING (greater_than, ">");
+ caller = concat3 (space_less_than, caller, greater_than);
break;
}
p->inherit_coding_system_flag
= (NILP (buffer) ? 0 : ps->inherit_coding_system_flag);
+ AUTO_STRING (dash, "-");
+ AUTO_STRING (nl, "\n");
+ Lisp_Object host_string = STRINGP (host) ? host : dash;
+
if (!NILP (ps->log))
- call3 (ps->log, server, proc,
- concat3 (build_local_string ("accept from "),
- (STRINGP (host) ? host : build_local_string ("-")),
- build_local_string ("\n")));
-
- exec_sentinel (proc,
- concat3 (build_local_string ("open from "),
- (STRINGP (host) ? host : build_local_string ("-")),
- build_local_string ("\n")));
+ {
+ AUTO_STRING (accept_from, "accept from ");
+ call3 (ps->log, server, proc, concat3 (accept_from, host_string, nl));
+ }
+
+ AUTO_STRING (open_from, "open from ");
+ exec_sentinel (proc, concat3 (open_from, host_string, nl));
}
/* This variable is different from waiting_for_input in keyboard.c.