aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c45
1 files changed, 24 insertions, 21 deletions
diff --git a/src/process.c b/src/process.c
index f6484d0370e..6d059af9cc8 100644
--- a/src/process.c
+++ b/src/process.c
@@ -620,7 +620,7 @@ status_message (struct Lisp_Process *p)
620 if (c1 != c2) 620 if (c1 != c2)
621 Faset (string, make_number (0), make_number (c2)); 621 Faset (string, make_number (0), make_number (c2));
622 } 622 }
623 string2 = build_local_string (coredump ? " (core dumped)\n" : "\n"); 623 string2 = SCOPED_STRING (coredump ? " (core dumped)\n" : "\n");
624 return concat2 (string, string2); 624 return concat2 (string, string2);
625 } 625 }
626 else if (EQ (symbol, Qexit)) 626 else if (EQ (symbol, Qexit))
@@ -630,15 +630,15 @@ status_message (struct Lisp_Process *p)
630 if (code == 0) 630 if (code == 0)
631 return build_string ("finished\n"); 631 return build_string ("finished\n");
632 string = Fnumber_to_string (make_number (code)); 632 string = Fnumber_to_string (make_number (code));
633 string2 = build_local_string (coredump ? " (core dumped)\n" : "\n"); 633 string2 = SCOPED_STRING (coredump ? " (core dumped)\n" : "\n");
634 return concat3 (build_local_string ("exited abnormally with code "), 634 return concat3 (SCOPED_STRING ("exited abnormally with code "),
635 string, string2); 635 string, string2);
636 } 636 }
637 else if (EQ (symbol, Qfailed)) 637 else if (EQ (symbol, Qfailed))
638 { 638 {
639 string = Fnumber_to_string (make_number (code)); 639 string = Fnumber_to_string (make_number (code));
640 string2 = build_local_string ("\n"); 640 string2 = SCOPED_STRING ("\n");
641 return concat3 (build_local_string ("failed with code "), 641 return concat3 (SCOPED_STRING ("failed with code "),
642 string, string2); 642 string, string2);
643 } 643 }
644 else 644 else
@@ -1302,30 +1302,33 @@ Returns nil if format of ADDRESS is invalid. */)
1302 ptrdiff_t size = p->header.size; 1302 ptrdiff_t size = p->header.size;
1303 Lisp_Object args[10]; 1303 Lisp_Object args[10];
1304 int nargs, i; 1304 int nargs, i;
1305 char const *format;
1305 1306
1306 if (size == 4 || (size == 5 && !NILP (omit_port))) 1307 if (size == 4 || (size == 5 && !NILP (omit_port)))
1307 { 1308 {
1308 args[0] = build_local_string ("%d.%d.%d.%d"); 1309 format = "%d.%d.%d.%d";
1309 nargs = 4; 1310 nargs = 4;
1310 } 1311 }
1311 else if (size == 5) 1312 else if (size == 5)
1312 { 1313 {
1313 args[0] = build_local_string ("%d.%d.%d.%d:%d"); 1314 format = "%d.%d.%d.%d:%d";
1314 nargs = 5; 1315 nargs = 5;
1315 } 1316 }
1316 else if (size == 8 || (size == 9 && !NILP (omit_port))) 1317 else if (size == 8 || (size == 9 && !NILP (omit_port)))
1317 { 1318 {
1318 args[0] = build_local_string ("%x:%x:%x:%x:%x:%x:%x:%x"); 1319 format = "%x:%x:%x:%x:%x:%x:%x:%x";
1319 nargs = 8; 1320 nargs = 8;
1320 } 1321 }
1321 else if (size == 9) 1322 else if (size == 9)
1322 { 1323 {
1323 args[0] = build_local_string ("[%x:%x:%x:%x:%x:%x:%x:%x]:%d"); 1324 format = "[%x:%x:%x:%x:%x:%x:%x:%x]:%d";
1324 nargs = 9; 1325 nargs = 9;
1325 } 1326 }
1326 else 1327 else
1327 return Qnil; 1328 return Qnil;
1328 1329
1330 args[0] = SCOPED_STRING (format);
1331
1329 for (i = 0; i < nargs; i++) 1332 for (i = 0; i < nargs; i++)
1330 { 1333 {
1331 if (! RANGED_INTEGERP (0, p->contents[i], 65535)) 1334 if (! RANGED_INTEGERP (0, p->contents[i], 65535))
@@ -1344,7 +1347,7 @@ Returns nil if format of ADDRESS is invalid. */)
1344 1347
1345 if (CONSP (address)) 1348 if (CONSP (address))
1346 return Fformat (2, ((Lisp_Object []) 1349 return Fformat (2, ((Lisp_Object [])
1347 { build_local_string ("<Family %d>"), Fcar (address) })); 1350 { SCOPED_STRING ("<Family %d>"), Fcar (address) }));
1348 1351
1349 return Qnil; 1352 return Qnil;
1350} 1353}
@@ -4060,11 +4063,11 @@ server_accept_connection (Lisp_Object server, int channel)
4060 unsigned char *ip = (unsigned char *)&saddr.in.sin_addr.s_addr; 4063 unsigned char *ip = (unsigned char *)&saddr.in.sin_addr.s_addr;
4061 4064
4062 host = Fformat (5, ((Lisp_Object []) 4065 host = Fformat (5, ((Lisp_Object [])
4063 { build_local_string ("%d.%d.%d.%d"), make_number (ip[0]), 4066 { SCOPED_STRING ("%d.%d.%d.%d"), make_number (ip[0]),
4064 make_number (ip[1]), make_number (ip[2]), make_number (ip[3]) })); 4067 make_number (ip[1]), make_number (ip[2]), make_number (ip[3]) }));
4065 service = make_number (ntohs (saddr.in.sin_port)); 4068 service = make_number (ntohs (saddr.in.sin_port));
4066 caller = Fformat (3, ((Lisp_Object []) 4069 caller = Fformat (3, ((Lisp_Object [])
4067 { build_local_string (" <%s:%d>"), host, service })); 4070 { SCOPED_STRING (" <%s:%d>"), host, service }));
4068 } 4071 }
4069 break; 4072 break;
4070 4073
@@ -4075,13 +4078,13 @@ server_accept_connection (Lisp_Object server, int channel)
4075 uint16_t *ip6 = (uint16_t *)&saddr.in6.sin6_addr; 4078 uint16_t *ip6 = (uint16_t *)&saddr.in6.sin6_addr;
4076 int i; 4079 int i;
4077 4080
4078 args[0] = build_local_string ("%x:%x:%x:%x:%x:%x:%x:%x"); 4081 args[0] = SCOPED_STRING ("%x:%x:%x:%x:%x:%x:%x:%x");
4079 for (i = 0; i < 8; i++) 4082 for (i = 0; i < 8; i++)
4080 args[i + 1] = make_number (ntohs (ip6[i])); 4083 args[i + 1] = make_number (ntohs (ip6[i]));
4081 host = Fformat (9, args); 4084 host = Fformat (9, args);
4082 service = make_number (ntohs (saddr.in.sin_port)); 4085 service = make_number (ntohs (saddr.in.sin_port));
4083 caller = Fformat (3, ((Lisp_Object []) 4086 caller = Fformat (3, ((Lisp_Object [])
4084 { build_local_string (" <[%s]:%d>"), host, service })); 4087 { SCOPED_STRING (" <[%s]:%d>"), host, service }));
4085 } 4088 }
4086 break; 4089 break;
4087#endif 4090#endif
@@ -4092,7 +4095,7 @@ server_accept_connection (Lisp_Object server, int channel)
4092 default: 4095 default:
4093 caller = Fnumber_to_string (make_number (connect_counter)); 4096 caller = Fnumber_to_string (make_number (connect_counter));
4094 caller = concat3 4097 caller = concat3
4095 (build_local_string (" <"), caller, build_local_string (">")); 4098 (SCOPED_STRING (" <"), caller, SCOPED_STRING (">"));
4096 break; 4099 break;
4097 } 4100 }
4098 4101
@@ -4191,14 +4194,14 @@ server_accept_connection (Lisp_Object server, int channel)
4191 4194
4192 if (!NILP (ps->log)) 4195 if (!NILP (ps->log))
4193 call3 (ps->log, server, proc, 4196 call3 (ps->log, server, proc,
4194 concat3 (build_local_string ("accept from "), 4197 concat3 (SCOPED_STRING ("accept from "),
4195 (STRINGP (host) ? host : build_local_string ("-")), 4198 (STRINGP (host) ? host : SCOPED_STRING ("-")),
4196 build_local_string ("\n"))); 4199 SCOPED_STRING ("\n")));
4197 4200
4198 exec_sentinel (proc, 4201 exec_sentinel (proc,
4199 concat3 (build_local_string ("open from "), 4202 concat3 (SCOPED_STRING ("open from "),
4200 (STRINGP (host) ? host : build_local_string ("-")), 4203 (STRINGP (host) ? host : SCOPED_STRING ("-")),
4201 build_local_string ("\n"))); 4204 SCOPED_STRING ("\n")));
4202} 4205}
4203 4206
4204/* This variable is different from waiting_for_input in keyboard.c. 4207/* This variable is different from waiting_for_input in keyboard.c.