Commit graph

3693 commits

Author SHA1 Message Date
Russ Cox
81d992e35f acme: factor out tag parsing code 2020-01-13 21:43:54 -05:00
Russ Cox
3a62e56307 lib9: do not fetch disk size for character devices
Real disk devices should be block devices anyway.
One user reported the disksize check causing a
system reboot during vac of a tree with an "interesting"
device.

Fixes #103.
2020-01-13 19:30:02 -05:00
Russ Cox
6c17f63090 mk: treat X= as empty list in rc shell
This brings mk's behavior when using rc in line with Plan 9's.
The existing code is for Unix environment data structures but
also was assuming Unix shell semantics where empty and missing
variables are mostly equivalent.

The Plan 9 code (/sys/src/cmd/mk/plan9.c in the distribution)
explicitly removes /env/name (creating an empty list) when the
value is missing or an empty string.

Fixes #255.
2020-01-13 19:20:34 -05:00
Russ Cox
9962d916e8 tmac: fix troff -ms .KS after .1C
Fixes #233.
2020-01-13 18:26:15 -05:00
Russ Cox
d2df5d6cbd acme: fix crash in X |cat with multiple windows
Fixes #9.
Fixes #219.
Fixes #222.
Fixes #330.
2020-01-13 18:15:57 -05:00
Russ Cox
59b460f845 vac, unvac: allow 128MB cache size, up from 4MB
When a directory has lots of children, vac crashes because it runs out of cache.

Fixes #266.
2020-01-13 17:09:39 -05:00
Russ Cox
fa588406f0 9pfuse: do not fswalk("..")
f is open, so walk will fail.
The comments say we only need one directory anyway.

Fixes #277.
2020-01-13 17:07:44 -05:00
Russ Cox
1c78140d83 TODO: remove, not updated in 15 years 2020-01-13 17:04:06 -05:00
Russ Cox
369923f6fc libthread: fix nbrecvul, recvul to match man page, Plan 9
They return 0 on failure, not -1.
Bug introduced in my original libthread-for-Unix code.

Fixes #230.
2020-01-13 17:00:58 -05:00
Nicola Girardi
93f9789c04 cmd/9pfuse: ignore FMODE_EXEC open flag
Improved error message in case of unexpected open flags. The message

    unexpected open flags requested=0100040 unhandled=040

prompted me to clear the FMODE_EXEC flag, although I wonder if I
shouldn't have set OEXEC (0x3) instead.
2020-01-13 16:56:57 -05:00
Russ Cox
ac6456a0cc clock: import from plan 9
Fixes #250.
2020-01-13 16:53:30 -05:00
Russ Cox
be263a722e lib9: rm unused _p9translate.c
Fixes #238.
2020-01-13 16:48:58 -05:00
Russ Cox
04da015976 devdraw: AUTOFRAMEWORK CoreFoundation on macOS
Fixes #273.
2020-01-13 16:47:16 -05:00
Russ Cox
50923426bf devdraw: x11 working again
Need to think a bit more about locking,
but overall it's a working devdraw.

Multiclient mode may not be working
but nothing is using it yet.
2020-01-13 16:46:14 -05:00
Russ Cox
892b3c4687 devdraw: multiclient mode 2020-01-13 16:46:14 -05:00
Russ Cox
2cb85891ba cmapcube: don't crash on initdraw failure 2020-01-13 16:46:14 -05:00
Russ Cox
dbf57689c4 libdraw: connect to devdraw via $wsysid when set 2020-01-13 16:46:14 -05:00
Russ Cox
41547af3f6 devdraw: more cleanup, clearer locking 2020-01-13 16:46:14 -05:00
Russ Cox
b1a086dee9 devdraw: refactor, clean up mac screen
Also turn mac-srv.c into a generic srv.c,
so we can remove the duplication with x11-srv.c.
2020-01-13 16:46:14 -05:00
Russ Cox
843e5af198 devdraw: move per-window globals in mac-screen.m into Client 2020-01-13 16:46:14 -05:00
Russ Cox
88ed92aa40 devdraw: move Client into devdraw.h and move global state in 2020-01-13 16:46:14 -05:00
Russ Cox
933b98054f devdraw: use consistent mac-* prefix on macOS files
We were using osx- and cocoa- but it's not even OS X anymore.
2020-01-13 16:46:14 -05:00
Russ Cox
ce27d7babd devdraw: can use libthread directly now on macOS 2020-01-13 16:46:14 -05:00
Russ Cox
db20f89c32 devdraw: simplify mac file names
Now that we only have Metal, we can drop the -metal.
Also now that Carbon is gone we can drop the macargv.c,
and then the -objc from object file names.
2020-01-13 16:46:14 -05:00
Russ Cox
f177c0ba18 devdraw: drop pre-metal macOS support
We didn't start using Metal until macOS 10.14,
but it was available on 10.13, which is currently
the oldest Apple-supported version of macOS.
Simplify by deleting the old code.
2020-01-13 16:46:14 -05:00
Russ Cox
cc3d97d52a devdraw: update drawclient test program to run again 2020-01-13 16:46:14 -05:00
Neven Sajko
bf59f0ed28 cmd/yacc: correctly detect end of file in gettok
This prevents an infinite loop.

Change-Id: I7eda6b9d032ca0daeb24b555954330d07f35c78b
2020-01-13 14:41:28 -05:00
Neven Sajko
eb4aea5072 cmd/yacc: check that arg is safe to pass to <ctype.h> isX functions
The functions from <ctype.h> require that their argument be
representable as an unsigned char, anything else is an error.

Change-Id: I9dafc49c431b7a2550b041603f27bac3c0010eea
2020-01-13 14:41:28 -05:00
Neven Sajko
d2fae53d17 cmd/yacc: check for EOF in string constant in cpyact
Change-Id: I3b41ab3f181080bcff89201d30f0bdf8aa20d55c
2020-01-13 14:41:28 -05:00
Neven Sajko
4a3f20bcee cmd/yacc: do not create an out of bounds pointer
An out of bounds pointer/array index being created is an error in
standard C.

Updates #313

Change-Id: I7108fcde1a8e03017e9ab852adb737940489c827
2020-01-13 14:41:28 -05:00
Russ Cox
7ba9f9467d lib9/fmt: avoid racy access to installed fmt formats 2020-01-13 11:42:24 -05:00
jvd23
d96e9e5dc3 lib9: fix memory leak in dial of regular file (#284) 2020-01-13 11:38:17 -05:00
Russ Cox
fa7fecff33 wintext: add tmux support, use in ", ""
Fixes #223.
2020-01-13 11:11:14 -05:00
Xiao-Yong
cc48e73a96 fontsrv: allow x11 hinting and disable autohint only (#254)
Some truetype fonts have good manual hinting.
Ignoring hinting makes the font render badly on low resolution screens.
This commit only disables the freetype autohinter, and allows hinting.
2020-01-13 11:02:13 -05:00
Edouard Klein
185fd7db05 Make venti's doc more accurate 2020-01-13 10:10:31 -05:00
Neven Sajko
386bd9cae4 cmd/venti/srv: split memory allocation call
This splits a certain vtmallocz call in mkihash into two vtmallocz
calls. The first issue this fixes is that the C aliasing rules were not
respected in the code before this commit. The other thing is that this
enables better memory alignment guarantees.

Updates #313

Change-Id: Ia4f3e0fc85facc778193f5e977d4f99a1a9abd23
2020-01-13 10:08:01 -05:00
Russ Cox
0b6b451b71 libdraw: fix "mk"
Should default to building the library, not getsubfont.o.
2020-01-12 15:08:28 -05:00
Russ Cox
0158bceec7 libthread: run first thread in proc on system stack
For pthread systems that are fussy about which stack is used,
this makes sure that threadmain runs on a system stack.
If you only use proccreate (never threadcreate), all threads run
on system stacks.
2020-01-12 15:08:28 -05:00
Russ Cox
e0c4896ed4 lib9: make a p9frexp function wrapping system frexp
Under certain conditions it looks like frexp gets #defined
to something else on macOS during system headers,
which then breaks the declaration in libc.h.
2020-01-12 15:07:42 -05:00
Russ Cox
fafa622a5b all: fix or silence various gcc warnings
As usual, gcc finds some real problems but also reports a ton
of noise. Fix the problems and quiet the noise.
2020-01-12 15:07:42 -05:00
Dan Cross
fa325e9b42 Trivial changes: whitespace and modes.
Remote whitespace at the ends of lines.
Remove blank lines from the ends of files.
Change modes on source files so that they
are not executable.

Signed-off-by: Dan Cross <cross@gajendra.net>
2020-01-10 14:54:30 +00:00
Russ Cox
77a0a5b519 src: mv ../buildEnvironmentVariables mkhdr
Also note that the file must be valid shell and mk input.
For #321.
2020-01-09 20:08:10 -05:00
Russ Cox
5aad8f3d6d mkfile, mkmk.sh: update for new asm-free getcallerpc 2020-01-09 19:57:56 -05:00
Russ Cox
323e1a8fac lib9: add getcallerpc.c (fixes build) 2020-01-08 22:27:51 -05:00
Neven Sajko
a18741729c libhtml: plug a memory leak in addtext
Change-Id: I9b8a4430e7d26008ba9508095f8eb4b124a93b9b
2020-01-08 08:50:01 -05:00
Neven Sajko
8241eca986 libhtml: plug quite a few memory leaks
Change-Id: I45bd62a590373669e90183cc2b2ee56570c007f5
2020-01-08 08:50:01 -05:00
Dan Cross
2738cc3cfc mk: plan9 style.
In general, no space after `if` etc, and no
braces for a single statement inside of a loop
or conditional.

Signed-off-by: Dan Cross <cross@gajendra.net>
2020-01-08 01:37:44 +00:00
Neven Sajko
c65d179354 mk: fix out of bounds access
A loop is added for each structure field instead of accessing the other
fields through the first one in one loop.

Updates #313

Change-Id: I0e27e15feacb77391bc1decee7cf720d64d14586
2020-01-07 20:25:18 -05:00
Martin Kühl
194178b578 9c: Fix case patterns for DragonFly and other BSDs
POSIX does not support grouping in case item patterns.
Installing with a strict POSIX shell fails with:

/usr/local/plan9/bin/9c: line 82: syntax error near unexpected token `('
/usr/local/plan9/bin/9c: line 82: `*(DragonFly|BSD)*gcc*)	usegcc ;;'

This change expands the patterns to work around the limitation.

See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_10
(and search for case_clause)
2020-01-07 18:13:02 -05:00
Neven Sajko
e6ed10f25e lib9, libndb: exclude terminating null from strncpy bound
GCC pointed this out with some "warning: ‘strncpy’ specified bound NUM
equals destination size [-Wstringop-truncation]" warnings.

Change-Id: Id8408b165f6e4ae82c96a77599d89f658d979b32
2020-01-07 16:23:40 -05:00