• merge printf from OpenBSD

• deactivate %a and %A since our libc doesn’t have it
• rewrite the mksh integration code to use shf instead of stdio, removing
  floating point support always in the process, as shf doesn’t support it
  ⇒ saves 11114 (6706 text, 168 data, 4240 bss) with dietlibc on Debian
• fix -Wall -Wextra -Wformat -Wstrict-aliasing=2 for gcc (Debian 4.4.4-7)
• fix these and -Wc++-compat for gcc version 4.6.0 20100711 (experimental)
  [trunk revision 162057] (Debian 20100711-1) except:
  – a few enum warnings that relate to eglibc’s {g,s}etrlimit() functions
    taking an enum instead of an int because they’re too stupid to adhere
    to POSIX interfaces they design by themselves
  – all “request for implicit conversion” involving a "void *" on one side
• tweak the manual page somewhat more
This commit is contained in:
tg
2010-07-17 22:09:40 +00:00
parent 1e113b416b
commit 7c91e018f4
13 changed files with 189 additions and 182 deletions

View File

@@ -26,7 +26,7 @@
#include <sys/file.h>
#endif
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.96 2010/07/04 17:45:14 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.97 2010/07/17 22:09:35 tg Exp $");
/*-
* MirOS: This is the default mapping type, and need not be specified.
@@ -956,7 +956,7 @@ writehistfile(int lno, char *cmd)
{
int sizenow;
unsigned char *base;
unsigned char *new;
unsigned char *news;
int bytes;
unsigned char hdr[5];
@@ -973,13 +973,13 @@ writehistfile(int lno, char *cmd)
MAP_FILE | MAP_PRIVATE, histfd, (off_t)0);
if (base == (unsigned char *)MAP_FAILED)
goto bad;
new = base + hsize;
if (*new != COMMAND) {
news = base + hsize;
if (*news != COMMAND) {
munmap((caddr_t)base, sizenow);
goto bad;
}
hist_source->line--;
histload(hist_source, new, bytes);
histload(hist_source, news, bytes);
hist_source->line++;
lno = hist_source->line;
munmap((caddr_t)base, sizenow);