Commit Graph

12239 Commits

Author SHA1 Message Date
Tim Kientzle
32baf20434 Merge r342 from libarchive.googlecode.com: Remove some
Windows special casing.
2009-03-05 00:36:13 +00:00
Tim Kientzle
faeada5e26 Merge r344 from libarchive.googlecode.com: __LA_INT64_T and __LA_SSIZE_T
are part of the public API and therefore need to be exposed.  This is
ugly; I'd like to find a better solution for this.
2009-03-05 00:35:21 +00:00
Tim Kientzle
ba2a6a7201 Merge r341,r345,r346,347 from libarchive.googlecode.com: Style
fixes to test harness and a few extra guards to detect tests
that can't succeed on certain platforms.
2009-03-05 00:31:48 +00:00
David Schultz
09efd0ec6a Add wcpcpy(3) and wcpncpy(3). 2009-03-04 06:01:27 +00:00
David Schultz
ad760e6fc9 Add dprintf() and vdprintf() from POSIX.1-2008. Like getline(),
dprintf() is a simple wrapper around another function, so we may as
well implement it. But also like getline(), we can't prototype it by
default right now because it would break too many ports.
2009-03-04 03:38:51 +00:00
David Schultz
ce5c3df1b2 Fix a file descriptor leak in fts_child().
Obtained from:	NetBSD
2009-03-04 03:30:21 +00:00
Bruce M Simpson
1acf7fcc63 Considerably improve the wording of this man page. 2009-03-04 01:59:14 +00:00
Bruce M Simpson
0c0fdcfe15 Update copyright. 2009-03-04 01:58:48 +00:00
Xin LI
eb3144b210 Explicitly specify bit width for on-disk data structure.
Obtained from:	OpenBSD
2009-03-04 01:17:05 +00:00
Xin LI
d170190aa8 Sync license changes.
Obtained from:	NetBSD
2009-03-04 01:01:26 +00:00
Xin LI
3df1d93483 Style changes (including additional casts to shut up warnings). This
commit does not affect MD5 of object file.
2009-03-04 00:58:04 +00:00
Tim Kientzle
9c886c4181 Merge r340 from libarchive.googlecode.com: If zlib/bzlib aren't available,
we can still detect gzip/bzip2 compressed streams, we just can't
decompress them.
2009-03-03 17:07:27 +00:00
Tim Kientzle
690f818afd Merge r294:337,r348:350 from libarchive.googlecode.com: A lot
of work to make libarchive work on Windows.
2009-03-03 17:02:51 +00:00
Tim Kientzle
ed466ea1cf Merge r294 from libarchive.googlecode.com: Skip testing for
locale-based failures on systems where the "C" locale is so permissive
that it cannot possibly fail.  In particular, this fixes a test
problem on Cygwin.
2009-03-03 07:01:57 +00:00
Tim Kientzle
bc14277c79 Merge r282 from libarchive.googlecode.com: Close multiple filters
by walking the filter list in archive_read_close().
2009-03-03 03:33:25 +00:00
Tim Kientzle
80bb6bf259 Merge r272 from libarchive.googlecode.com: Fix building on MSVC6. 2009-03-03 03:28:09 +00:00
Xin LI
4c66e4b64b Rename variable 'index' to 'idx' to avoid name collision with index(3),
this commit does not affect any object code.

Obtained from:	OpenBSD
Verified with:	md5(1)
2009-03-03 02:16:12 +00:00
Xin LI
0ac22237f1 Diff reduction against OpenBSD: ANSI'fy prototypes.
(This is part of a larger changeset which is intended to reduce diff only,
thus some prototypes were left intact since they will be changed in the
future).

Verified with:	md5(1)
2009-03-02 23:47:18 +00:00
Konstantin Belousov
65067cc8b0 Correct types of variables used to track amount of allocated SysV shared
memory from int to size_t. Implement a workaround for current ABI not
allowing to properly save size for and report more then 2Gb sized segment
of shared memory.

This makes it possible to use > 2 Gb shared memory segments on 64bit
architectures. Please note the new BUGS section in shmctl(2) and
UPDATING note for limitations of this temporal solution.

Reviewed by:	csjp
Tested by:	Nikolay Dzham <i levsha org ua>
MFC after:	2 weeks
2009-03-02 18:53:30 +00:00
David Schultz
601b205e47 Rewrite asprintf() as a wrapper around vasprintf(), thus reducing the
number of functions that have an incestuous relationship with the
arcane innards of stdio.
2009-03-02 04:11:42 +00:00
David Schultz
88f919d683 The argument corresponding to %zn is supposed to be an ssize_t *, not
a size_t *, although the distinction is moot in practice.
2009-03-02 04:07:58 +00:00
David Schultz
9e462ed058 Use C99-style initializers. No functional change.
Reviewed by:	md5(1)
2009-03-01 19:25:40 +00:00
Xin LI
a8da143ab8 Add a missing .El. 2009-03-01 05:47:14 +00:00
Xin LI
00d949789a "-isoC-99" should be spelled without 'c'. 2009-03-01 05:44:28 +00:00
Ed Schouten
6cf4a02c5e Add missing POSIX 1003.1-2008 open(2) flag; O_TTY_INIT.
On FreeBSD, this is the default behaviour. According to the spec, we may
give this flag a value of zero, but I'd rather not do this. If we define
it to a non-zero value, we can always change default behaviour without
changing the ABI. This is very unlikely to happen, though.
2009-02-28 10:10:30 +00:00
David Schultz
353ce11c8b Replace a dozen lines of code with a call to strnlen() / wcsnlen(). 2009-02-28 06:06:57 +00:00
David Schultz
9c5cb6d8ae Add restrict qualifiers.
I missed this file in my previous commit.
2009-02-28 06:05:37 +00:00
David Schultz
69099ba2ec - Add getdelim(), getline(), stpncpy(), strnlen(), wcsnlen(),
wcscasecmp(), and wcsncasecmp().
- Make some previously non-standard extensions visible
  if POSIX_VISIBLE >= 200809.
- Use restrict qualifiers in stpcpy().
- Declare off_t and size_t in stdio.h.
- Bump __FreeBSD_version in case the new symbols (particularly
  getline()) cause issues with ports.

Reviewed by:	standards@
2009-02-28 06:00:58 +00:00
David Schultz
e00a6d21eb Add restrict qualifiers to the parameters to strlcpy() and strlcat().
The annotation mainly just serves as a hint that they're not intended
for use with overlapping strings.
2009-02-28 05:15:02 +00:00
David Schultz
0881683b36 Make sure %zd treats negative arguments properly on 32-bit platforms.
Fix harmless but related bugs in %_$zd and %_$tu.

PR:		131880
MFC after:	1 week
2009-02-28 04:58:18 +00:00
Andrew Thompson
ee3e3ff5c2 Change USB over to make_dev() for all device nodes, previously it hooked into
the devfs clone handler to open the (invisible) devices on the fly.

The /dev entries are layed out as follows,

 /dev/usbctl      = master device
 /dev/usb/0.1.0.5 = usb device, (<bus>.<dev>.<iface>.<endpoint>)
 /dev/ugen0.1 -> usb/0.1.0.0 = ugen link to ctrl endpoint

This also removes the custom permissions model from USB.  Bump
__FreeBSD_version to 800066.

Submitted by:	rink (earlier version)
2009-02-27 17:27:16 +00:00
Andrew Thompson
e35ceb121b Fix HID_COMPAT7 handling around the USB_GET_REPORT_DESC ioctl.
Submitted by:	daichi
Pointy hat:	me
2009-02-27 15:30:42 +00:00
Ed Schouten
b3aaa0cc21 Rename all symbols in libmp(3) to mp_*, just like Solaris.
The function pow() in libmp(3) clashes with pow(3) in libm. We could
rename this single function, but we can just take the same approach as
the Solaris folks did, which is to prefix all function names with mp_.

libmp(3) isn't really popular nowadays. I suspect not a single
application in ports depends on it. There's still a chance, so I've
increased the SHLIB_MAJOR and __FreeBSD_version.

Reviewed by:	deischen, rdivacky
2009-02-26 21:43:15 +00:00
Ed Schouten
e0e0f30f42 Use ANSI function declarations in librpcsvc.
When compiling librpcsvc with LLVM, we get a compiler error, because
hexval() uses an ANSI prototype, but a K&R declaration. I could have
just changed hexval(), but I'd rather keep this consistent. It's not
that much code.

Submitted by:	Pawel Worach <pawel worach gmail com>
2009-02-26 20:32:11 +00:00
Roman Divacky
b9c4b6b4df Add a missing parameter to ruserpass(). According to C99 6.9.1p7
K&R function is not a prototype but this is a bad style. GCC accepts
this other compilers warn or reject this.

Approved by:	kib (mentor)
2009-02-26 17:46:54 +00:00
Ruslan Ermilov
241715e78f With only one threading library, simplify the logic of setting SHLIBDIR. 2009-02-24 16:23:34 +00:00
Andrew Thompson
f78fa6b67e MFp4 //depot/projects/usb@157974
Add support for setting and getting the USB template value through libusb20 and
usbconfig.

Submitted by:	Hans Petter Selasky
2009-02-24 03:43:05 +00:00
Andrew Thompson
bf41796c4e Build fixups for the new USB stack. 2009-02-23 18:36:54 +00:00
Ruslan Ermilov
d9ca85fca7 Fix build when WITH_SSP is set explicitly.
Submitted by:	Jeremie Le Hen
2009-02-21 15:04:31 +00:00
Warner Losh
21fc9f2bcc These warnings are only relevant on NetBSD it seems. They don't seem
to be relevant to FreeBSD at all.
2009-02-19 19:53:58 +00:00
Warner Losh
51cbd5d9d7 These symbols don't belong here. Remove them. Since mips hasn't had
a release, I think there's no impact here...

Reviewed by:	cognet@
2009-02-19 18:03:41 +00:00
Dag-Erling Smørgrav
1dde0f9745 Don't try to auto-detect dynamic linking; it fails on mips. The Makefile
part of the patch is an ugly (and hopefully temporary) hack.

Discussed with:	imp@
2009-02-17 16:35:19 +00:00
Andrew Thompson
e9df28284b MFp4 //depot/projects/usb@157783
libusb20: Make return value compatible with libusb0.12.x in case of a USB
transfer timeout.

Submitted by:	Hans Petter Selasky
2009-02-16 15:32:12 +00:00
Andrew Thompson
06d497c1af MFp4 //depot/projects/usb@157699
Add two new functions to the libusb20 API and required kernel ioctls.

- libusb20_dev_get_iface_desc
- libusb20_dev_get_info

New command to usbconfig, "show_ifdrv", which will print out the kernel driver
attached to the given USB device aswell.

See "man libusb20" for a detailed description.

Some minor style corrections long-line wrapping.

Submitted by:	Hans Petter Selasky
2009-02-14 23:20:00 +00:00
Jung-uk Kim
455cc6ec70 Honor WITHOUT_INSTALLLIB in some places. 2009-02-13 16:51:36 +00:00
Ed Schouten
a73306e14e Properly invalidate highest pts number when calling setttyent().
When calling setttyent() after calling endttyent(), pts_valid will never
be set to 1, because the readdir()-loop will likely never vind a pts
that has a higher number than before.

Simplify the code by removing pts_valid. We'll just set maxpts to -1
when we don't have a valid count yet.
2009-02-12 19:32:52 +00:00
Ed Schouten
046f351281 Make ttyslot(3) work with pts(4) devices.
It seems ttyslot() calls rindex(), to strip the device name to the last
slash, but this is obviously invalid. /dev/pts/0 should be stripped
until pts/0. Because /etc/ttys only supports TTY names in /dev/, just
strip this piece of the pathname.
2009-02-12 19:00:13 +00:00
Ed Schouten
26d4f5e969 Add two new routines: fdevname() and fdevname_r().
A more elegant way of obtaining a name of a character device by its file
descriptor on FreeBSD, is to use the FIODGNAME ioctl. Because a valid
file descriptor implies a file descriptor is visible in /dev, it will
always resolve a valid device name.

I'm adding a more friendly wrapper for this ioctl, called fdevname(). It
is a lot easier to use than devname() and also has better error
handling. When a device name cannot be resolved, it will just return
NULL instead of a generated device name that makes no sense.

Discussed with:	kib
2009-02-11 20:24:59 +00:00
Ulf Lilleengen
043767b123 - Sanitize disk parameters retrieved from GEOM, as they are not guaranteed to
have sane values. It caused sysinstall to crash when installing on certain SD
  cards.

Discussed with:		marcel
2009-02-09 21:34:06 +00:00
Hajimu UMEMOTO
aba831de03 Shutup warning for DNAME RR.
PR:		bin/127591
Submitted by:	"Eugene M. Kim" <20080111.freebsd.org__at__ab.ote.we.lv>
MFC after:	1 week
2009-02-08 16:58:05 +00:00