mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-04 02:08:30 +00:00
Make improvements
- Expand redbean UNIX module - Expand redbean documentation - Ensure Lua copyright is embedded in binary - Increase the PATH_MAX limit especially on NT - Use column major sorting for linenoise completions - Fix some suboptimalities in redbean's new UNIX API - Figured out right flags for Multics newline in raw mode
This commit is contained in:
parent
cf3174dc74
commit
2046c0d2ae
305 changed files with 6602 additions and 4221 deletions
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/bits/bits.h"
|
||||
#include "libc/fmt/kerrornames.internal.h"
|
||||
#include "libc/fmt/magnumstrs.internal.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
|
@ -35,15 +35,12 @@ static char g_strsignal[12];
|
|||
* @see sigaction()
|
||||
*/
|
||||
char *strsignal(int sig) {
|
||||
int i;
|
||||
const char *s;
|
||||
strcpy(g_strsignal, "SIG");
|
||||
if (sig) {
|
||||
for (i = 0; kStrSignal[i].x; ++i) {
|
||||
if (sig == *(const int *)((uintptr_t)kStrSignal + kStrSignal[i].x)) {
|
||||
strcpy(g_strsignal + 3,
|
||||
(const char *)((uintptr_t)kStrSignal + kStrSignal[i].s));
|
||||
return g_strsignal;
|
||||
}
|
||||
if ((s = GetMagnumStr(kSignalNames, sig))) {
|
||||
strcpy(g_strsignal + 3, s);
|
||||
return g_strsignal;
|
||||
}
|
||||
}
|
||||
if (!sig) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue