Commit graph

7934 commits

Author SHA1 Message Date
Sigrid
de34481f8b oggdec: give it enough chance to seek from the start, where first seek might be still too close to the beginning of the file 2020-08-18 16:45:00 +02:00
Sigrid
5405ee61ae audio/oggdec: allow -s 0 2020-08-12 22:26:06 +02:00
Sigrid
601dd12651 audio/mp3dec: mad timer duration is all wrong, use samples instead 2020-08-12 11:42:00 +02:00
Sigrid
81dba13271 audio/mp3dec: add -s SECONDS option 2020-08-12 10:43:46 +02:00
Sigrid
5fcf2040b4 audio(1): add new -s SECONDS option 2020-08-11 17:27:11 +02:00
Sigrid
4ba367d435 audio/oggdec: add -s SECONDS option to seek before decoding 2020-08-11 17:26:33 +02:00
Sigrid
2e6f158f4d audio/flacdec: add -s SECONDS option to seek before decoding 2020-08-11 17:25:53 +02:00
Ori Bernstein
69c3c0e6f0 tmdate(2): fix typo (thanks mveety)
sysfata => sysfatal
2020-08-10 20:33:39 -07:00
Ori Bernstein
46faca54ed stdio.h: correct return type of putc
The putc macro is specified as returning an int, but our
type conversion rules turned it into a uint. Put in the
appropriate cast to make the type what we want.
2020-08-10 19:36:09 -07:00
Ori Bernstein
1e315f896d aux/ms2, aux/na: fix warnings
aux/na was comparing the return of putc with <0, when it should
have been comparing against EOF, which is not specified as -ve.

aux/ms2 was zero-extending the mask for the address when it
should have been sign extended.
2020-08-10 19:35:05 -07:00
Ori Bernstein
c834f535b7 seconds: use new libc date api 2020-08-10 19:02:09 -07:00
Ori Bernstein
6d3a2e6531 date: use new libc date apis. 2020-08-10 19:01:45 -07:00
Ori Bernstein
9db78003db merge 2020-08-10 19:00:59 -07:00
Sigrid
6e039d7b49 vmx: does not do well with certain fb widths, so restrict it 2020-08-10 16:38:26 +02:00
Ori Bernstein
e702cfcafd upas/fs: port date parsing to libc apis
There was a lot of code in upas/fs to deal with dates.
Now there isn't.
2020-08-09 19:46:38 -07:00
Ori Bernstein
9d446410c5 ip/httpd: fix 'mk nuke' 2020-08-09 19:00:06 -07:00
Ori Bernstein
56e869ac70 libc: new date apis
The current date and time APIs on Plan 9 are not good. They're
inflexible, non-threadsafe, and don't expose timezone information.

This commit adds new time APIs that allow parsing arbitrary
dates, work from multiple threads, and can handle timezones
effectively.
2020-08-09 18:58:44 -07:00
Ori Bernstein
3ba1d83d20 cc: promote integer constants according to c99 spec.
C99 integer constants with no type suffix promote differently
depending on the way that they're written: hex and oct consts
promote as int => uint => long => ulong => vlong => uvlong.
Decimal constants are always signed.

We used to promote all values to uint on overflow, and never
went wider. This change fixes that, and adds a warning when
a decimal constant that would have been promoted to uint in
the past gets promoted to int.
2020-08-08 11:39:25 -07:00
cinap_lenrek
ac4e21f52d ndb/dns: allow multiple txt, nullrr, cert, key and sig records (thanks kvik)
The de-duplication of txt, nullrr, cert, key and sig records
reduced all records to a single one.

Also, dblookup1() missed the txt record case and did not return
a unique list of rr's.

Now we consider these records unique if their value is different.
The new txtequiv() function does that for TXT records, which is
a bit tricky as it needs to take different segmentation into account.
2020-08-08 18:37:10 +02:00
Sigrid
93b475981e vmx: set xstart to either nsec or cycles depending on what is available 2020-08-07 17:08:49 +02:00
Sigrid
711b69c047 bullshit: decentralized ActivityPub 2020-08-07 15:50:55 +02:00
Sigrid
1cddff55da libttf: fix cmap subtable offset type and rank UCS-4 higher (more codepoints). fixes runes > 0xffff 2020-08-05 14:25:21 +02:00
cinap_lenrek
e1da4f1750 kernel: don't strip binaries in bootfs.paq 2020-08-04 16:31:24 +02:00
cinap_lenrek
5915d12ea4 qball: remove unused #include <stdio.h> 2020-08-04 16:27:27 +02:00
cinap_lenrek
d913f652f5 devmnt: print chanpath for unexpected reply tag 2020-08-04 16:23:22 +02:00
cinap_lenrek
53800208bd rc: avoid stat calls for directory globbing
On Plan9, we can count on Readdir() onlydirs argument
to work, which allows us to avoid stating every single
file to see if it is a directory.
2020-08-04 16:21:37 +02:00
Sigrid
e9df4c718a libttf: check directory() result 2020-08-04 11:42:43 +02:00
cinap_lenrek
4bbf1d12b5 7c: now really fix OASxxx operations
the previous patch broke 64-bit ops as the type for the
operation is determined from the first argument to
gopcode() (nod1.type), not the type the result (nod.type).

so we need to include the conversion of nod1 type to
the type of nod.
2020-08-04 00:50:33 +02:00
cinap_lenrek
1d07c2a161 merge 2020-08-03 23:17:32 +02:00
cinap_lenrek
d42f9b5110 reverting 7c change, breaks some 64-bit shifts... 2020-08-03 23:16:41 +02:00
cinap_lenrek
c4cf92b99e merge 2020-08-03 21:52:22 +02:00
cinap_lenrek
053a6526e2 acme: reverting scroll change, causes continuous scrolling with scrollwheel 2020-08-03 21:51:25 +02:00
cinap_lenrek
cbe45e78f9 7c: fix wrong type on OASxxx operations
the bug can be reproduced with the following test case:

#include <u.h>
#include <libc.h>

void
main()
{
	int size = 1;
	size*=1.5;
	exits(0);
}

this produces the following assembly:

	TEXT	main+0(SB),0,$16
	MOVW	$1,R1
	FCVTZSDW	$1.50000000000000000e+00,R2	<- tries to convert rhs to int??
	MULW	R2,R1,R2 <- multiplication done in int? bug!
	MOV	$0,R0
	BL	,exits+0(SB)
	RETURN	,
	END	,

the confusion comes from the *= operation using the wrong type
for the multiplication. in this case we should use the float
type of the rhs, do the operation, and then convert the result
back to int type of the lhs.

this change ports the same logic from 5c's getasop().
2020-08-02 19:48:25 +02:00
Alex Musolino
cf69bb920a rc-httpd: fix invalid test(1) invocation in dir-index 2020-08-02 18:30:01 +09:30
Ori Bernstein
9e27ee094c deroff: fix out-of-bounds access if runes above 0X80 are inside EQ clauses (thanks mmnmnnmnmm, via plan9port)
Characters greater than 0X80 will cause a read beyond the bounds of the
array chars[]. For particular unicode characters this can cause deroff
to segfault.

A minimal example:
$ deroff
.EQ
u∈
Segmentation fault

Throughout deroff, charclass() is used instead of directly indexing
chars[] so I presume this was just missed.
2020-08-01 10:54:03 -07:00
Ori Bernstein
6dbecfb457 htmlroff: fix out of bounds access (thanks Rei-sen, via plan9port)
_readx() uses rune count as its argument and not size, so we should
pass nelem() instead of sizeof().
2020-08-01 10:49:29 -07:00
kvik
0eb81f7320 mk9660(8): fix reference to proto file format 2020-08-01 16:17:29 +02:00
kvik
e5894dccea pre-lib9p servers: fix incorrect Tversion handling
version(5) says:

	If the server does not understand the client's version
	string, it should respond with an Rversion message (not
	Rerror) with the version string the 7 characters
	``unknown''.

Pre-lib9p file servers -- all except cwfs(4) -- do return Rerror.

lib9p(2) follows the above spec, although ignoring the next part
concerning comparison after period-stripping.  It assumes an
Fcall.version starting with "9P" is correctly formed and returns
the only supported version of the protocol, which seems alright.

This patch brings pre-lib9p servers in accordance with the spec.
2020-08-01 15:27:28 +02:00
Sigrid
88a468f205 vmx(1): use _tos->cyclefreq (thanks cinap) 2020-08-01 15:23:51 +02:00
Ori Bernstein
d287f178aa dc: increase exponent limit (thanks unboe, lyndon)
dc has an arbitrary limit on the size of the exponent. Lets
replace it with a different arbitrary limit.
2020-07-31 08:52:17 -07:00
Sigrid
9965e575f8 vmx(1): add missing file 2020-07-31 15:51:32 +02:00
Sigrid
853f0e33fe vmx(1): use cycles() instead of nsec() when possible
this provides better timing and reduced number of syscalls (~2.7M old
vs ~35K new in a test)
2020-07-31 15:48:54 +02:00
Sigrid
de27182a8e vmx: use _actual_ system kbmap 2020-07-31 11:24:02 +02:00
Sigrid
eb65fc5e69 aux/acpi: forgot to commit -p option 2020-07-30 15:59:04 +02:00
Sigrid
edb6f64d35 aux/acpi: write a man page, fix usage, call threadexits 2020-07-30 11:25:14 +02:00
Alex Musolino
02f19713a1 sshfs: update usage text to match man page 2020-07-29 13:56:03 +09:30
Ori Bernstein
c03079ad08 upasfs: make imap debug logging less noisy
The current logging prints a debug line for every
message in an inbox, which is unusably verbose.
This removes the prints for unchanged messages,
and adds a print for flag changes.
2020-07-26 19:12:48 -07:00
Ori Bernstein
ea98dafce5 replica: fix mkfile script installation (thanks Amavect)
The $SCRIPTS were added to $TARG, which complicates the all rule, as
each script's object file must be suppressed.
Fix by removing $SCRIPTS from $TARG, removing the script object file
suppression rule, and overriding the install rule.

The script bin install rule assumes that only one script install is
called at a time. Valid calls like 'mk -a /$objtype/replica/changes
/$objtype/replica/pull' will fail.
Fix by adding a for loop.

Remove the unused $UPDATE variable.
2020-07-20 18:58:52 -07:00
Ori Bernstein
2d59d75e3a stdio: fix warnings, make code more standard
Masking with _IO_CHMASK after the assignment causes a warning.
We're better off masking before, but casting the assignment to
prevent sign extension.
2020-07-19 14:14:14 -07:00
cinap_lenrek
9ea93a5fd3 libndb: order subnets by prefix length for ndbipinfo() lookups
to reproduce:

ipnet=foo0 ip=192.168.0.0 ipmask=/16
ipnet=foo1 ip=192.168.0.0 ipmask=/24
ip=192.168.0.1 sys=foo2

% ndb/ipquery sys foo2 ipnet ipmask
ipnet=foo0 ipmask=/16

we would expect to get ipnet=foo1 here as it is more
specific subnet.

the solution is to order the subnets by prefix length
in subnet() before calling filter(), so that we process
the longest prefixes first.
2020-07-17 16:53:20 +02:00