Make improvements

- Bump redbean up to 2.0
- Trim down the MODE=tiny build a bit
- Add Indian Standard Time to zoneinfo
This commit is contained in:
Justine Tunney 2022-04-29 00:36:14 -07:00
parent c9a981fdbe
commit 7aafa64ab3
17 changed files with 233 additions and 179 deletions

View file

@ -14,7 +14,7 @@
#include "libc/runtime/symbols.internal.h"
int main(int argc, char *argv[]) {
// ShowCrashReports();
ShowCrashReports();
if (IsDebuggerPresent(false)) {
kprintf("debugger found!%n");

View file

@ -43,7 +43,6 @@ void PrintUri(const char *path) {
}
int main(int argc, char *argv[]) {
ShowCrashReports();
int i;
while ((i = getopt(argc, argv, "?h")) != -1) {
switch (i) {

View file

@ -7,6 +7,7 @@
http://creativecommons.org/publicdomain/zero/1.0/ │
*/
#endif
#include "libc/dce.h"
#include "libc/log/log.h"
#include "libc/runtime/gc.internal.h"
#include "libc/stdio/stdio.h"
@ -67,7 +68,7 @@ void PrintImg(const char *path) {
}
int main(int argc, char *argv[]) {
ShowCrashReports();
if (!NoDebug()) ShowCrashReports();
int i;
while ((i = getopt(argc, argv, "?huas01234")) != -1) {
switch (i) {

View file

@ -153,7 +153,7 @@ void LoadWords(void) {
}
int main(int argc, char *argv[]) {
ShowCrashReports();
if (!NoDebug()) ShowCrashReports();
LoadWords();
SpellChecker();
return 0;

View file

@ -12,6 +12,7 @@
#include "libc/calls/struct/sigaction.h"
#include "libc/calls/struct/termios.h"
#include "libc/calls/struct/winsize.h"
#include "libc/dce.h"
#include "libc/log/check.h"
#include "libc/log/gdb.h"
#include "libc/log/log.h"
@ -152,7 +153,7 @@ void Draw(void) {
int main(int argc, char *argv[]) {
struct sigaction sa[2] = {{.sa_handler = OnShutdown},
{.sa_handler = OnInvalidate}};
ShowCrashReports();
if (!NoDebug()) ShowCrashReports();
Setup();
Enter();
GetTtySize();

View file

@ -36,12 +36,12 @@ static void SetLimit(int resource, uint64_t soft, uint64_t hard) {
lim.rlim_max = MIN(hard, old.rlim_max);
lim.rlim_cur = MIN(soft, lim.rlim_max);
if (!setrlimit(resource, &lim)) {
fprintf(stderr, "%snote: setrlimit(%s) downgraded to {%,ld, %,ld}\n",
fprintf(stderr, "%sNOTE: SETRLIMIT(%s) DOWNGRADED TO {%,ld, %,ld}\n",
__strace_rlimit_name(resource), lim.rlim_cur, lim.rlim_max);
return;
}
}
fprintf(stderr, "error: setrlimit(%s, %,ld, %,ld) failed %m%n",
fprintf(stderr, "ERROR: SETRLIMIT(%s, %,ld, %,ld) FAILED %m%n",
__strace_rlimit_name(resource), soft, hard);
exit(1);
}
@ -63,7 +63,7 @@ int main(int argc, char *argv[]) {
for (i = 0; i < RLIM_NLIMITS; ++i) {
rc = getrlimit(i, &rlim);
printf("setrlimit(%-20s, %,16ld, %,16ld) → %d %s\n",
printf("SETRLIMIT(%-20s, %,16ld, %,16ld) → %d %s\n",
__strace_rlimit_name(i), rlim.rlim_cur, rlim.rlim_max, rc,
!rc ? "" : strerror(errno));
}

View file

@ -7,8 +7,9 @@
http://creativecommons.org/publicdomain/zero/1.0/ │
*/
#endif
#include "libc/calls/calls.h"
#include "libc/fmt/conv.h"
#include "libc/stdio/stdio.h"
#include "libc/fmt/itoa.h"
/**
* @fileoverview Prints sequence of numbers.
@ -16,6 +17,7 @@
int main(int argc, char *argv[]) {
long a, b, i;
char buf[21], *p;
switch (argc) {
case 2:
a = 1;
@ -29,6 +31,9 @@ int main(int argc, char *argv[]) {
return 1;
}
for (i = a; i <= b; ++i) {
printf("%ld\n", i);
p = buf;
p = FormatInt64(p, i);
*p++ = '\n';
write(1, buf, p - buf);
}
}