Commit Graph

59651 Commits

Author SHA1 Message Date
Murai Takashi
4a23a66c83 ICNSTranslator: Fix PVS 2199
Merge two if statements that has same conditional expressions
at line 131 and 138.

Change-Id: I8eb69fc81f723502cfc48e1acbb9bf5e55023150
Reviewed-on: https://review.haiku-os.org/c/916
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-01-27 16:18:58 +00:00
Murai Takashi
1342ec2c91 Storage Kit: Fix PVS 692
Merge two if statements that has same conditional expressions
at line 198 and 201.

Change-Id: I797a77d7f2b88ae2cacd8569fdd09c0d1a19d038
Reviewed-on: https://review.haiku-os.org/c/915
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-01-27 16:18:06 +00:00
Adrien Destugues
20312cfe7b BSecureSocket: cleanup, no functional changes
Change-Id: I3355067efe4c5d71f8656d244e17bb11175600eb
Reviewed-on: https://review.haiku-os.org/c/910
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-27 07:55:55 +00:00
Adrien Destugues
1322d50732 HttpRequest: write whole request to socket
Better performance by using a single write, and some servers may not be
happy about getting so many TCP fragments for the HTTP header.

Change-Id: If7139e2a7748ea423d470676e70bd523a89031b2
Reviewed-on: https://review.haiku-os.org/c/909
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-27 07:55:55 +00:00
Rob Gill
27aefde9fd add-ons/disk_systems Fix printf format - PVS 2049
*	printf type set to unsigned

Change-Id: Ib4a8e1bb56c9e00ce90adef680db651fb17686c0
Reviewed-on: https://review.haiku-os.org/c/901
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-26 20:48:21 +00:00
Adrien Destugues
71aec29751 PPM translator: use a buffer for reading
Reading the file 1 byte at a time from a BFile is very inefficient.
Add a buffer, which makes things a lot faster (parsing a 200x200 image
used to run for a few seconds with 100% CPU use).

Change-Id: Ie2eea819475c9301fbb6102c41fa05ec2d2ca343
Reviewed-on: https://review.haiku-os.org/c/906
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-26 20:46:59 +00:00
Adrien Destugues
58913f60e8 PPM translator: read 1-bit and greyscale files
Change-Id: I0d9de6cb6eca99a78aada00c5299c16668c414f8
Reviewed-on: https://review.haiku-os.org/c/905
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-26 20:46:59 +00:00
Adrien Destugues
5d57984ba5 PPM translator: remove pre-R4 support
Change-Id: I26721cdd767bbf0df2936e97a2af322fed49cabf
Reviewed-on: https://review.haiku-os.org/c/904
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-26 20:46:59 +00:00
Adrien Destugues
32c7f1e79f MIME db: identify ASCII variant of PPM; PBM, PGM files
Change-Id: I05574601bfae0094b7509a123cfd19d7fb02e7fd
Reviewed-on: https://review.haiku-os.org/c/903
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-26 20:46:59 +00:00
Adrien Destugues
72c5a125f1 PPM translator: clang-format
Change-Id: I290f9b369af37d919308759b83c42122f7f309bc
Reviewed-on: https://review.haiku-os.org/c/902
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-26 20:46:59 +00:00
Augustin Cavalier
4bf8cf7a1b DefaultMediaTheme: Properly set control targets.
In removing the "GroupView" class and replacing it with a real BGroupView,
I missed that it its AttachedToWindow() implementation iterated over all
child controls and set their targets to themselves. It seems this is how
the Media Kit gets change messages from them, and so the lack of this
broke changing parameter values. Whoops.

But it seems that changing menu option values has been broken for a long time
(perhaps forever?), as in order for a BOptionPopUp to send messages to anything,
its AttachedToWindow() must be called (as this sets the BMenuItem's targets
to itself, so it can forward the messages.) So now that is fixed too.
2019-01-26 15:36:43 -05:00
Augustin Cavalier
132990ecdc idualwifi7260: Fix logic errors in iwm_pcie_load_firmware_chunk.
* There's no reason to have a while() loop here, because:
    - if msleep returns 0, that means we were woken up by the interrupt handler,
      and we are going to exit immediately as sc_fw_chunk_done will now be 1
      (there is nothing else that sleeps on sc_fw.)
    - if msleep doesn't return 0 (i.e. it returned ETIMEDOUT) then we will
      exit immediately because of the if-test.
   So, just use a single msleep() and then check sc_fw_chunk_done as before.
 * The comment said we were sleeping for 5 seconds, but the msleep was only
   for 1. Before the "sync firmware loading" FreeBSD commit, this was 1
   second and so was the comment, and in that commit the comment was changed
   and the function call wasn't.

The bugs here were introduced in the same FreeBSD commit as the "sizeof" bug
that I merged a fix for earlier.

Possibly fixes failures to initialize uCode on certain devices.
2019-01-25 11:25:16 -05:00
Rob Gill
aa7f93c54c src/apps Code formatting
*	No functional changes

		code formatting changes only

Change-Id: I046ae21d9b288126022fe0bc2ddf827843765e70
Reviewed-on: https://review.haiku-os.org/c/896
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-01-25 12:40:34 +00:00
Fredrik Holmqvist
9edb207fab Fix for bug 6991, replace registrars timer tick
Registrar schedules an event every second to do
fRoster-CheckSanity(). This uses 2.5% cpu on my machine
when idle. Changing it to five seconds lowers it to 0.1%

waddlesplash then pointed me to this bug which changes it
to watch for team deletion and call fRoster->CheckSanity()

As I know little in this area, it's mostly based on what
LaunchDaemon does in MessageRecieved.

Change-Id: Ie69f9399cab41d2d492d469b5d3dc88e6080c15c
Reviewed-on: https://review.haiku-os.org/c/876
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-24 18:57:50 +00:00
Augustin Cavalier
f290b76670 People: Enclose PeopleView in a BScrollView.
People uses a customizeable set of attributes, and on my install
that has a lot of old BeOS applications, the window is too tall
for the screen. So now it will be possible to scroll it.

Depends on the prior change to BScrollView to auto-update
scrollbar limits when the window size changes, as otherwise
you will not be able to scroll properly.

As you can see by the date, I've had this patch sitting around
for almost 2 years now, waiting for BScrollView layouted behavior
to be fixed...

Change-Id: Iee7a691771d3b17efb2f6aba8c5011986ad0e36b
Reviewed-on: https://review.haiku-os.org/c/894
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-24 18:52:39 +00:00
Augustin Cavalier
9e7d077d1b Media Kit: Remove DynamicScrollView from DefaultMediaTheme.
As of the last commit, a BScrollView in layouted mode now behaves
this way by default.

Change-Id: I07bd17d6d20e494c0e2f08172c0d54b10fa5d26d
Reviewed-on: https://review.haiku-os.org/c/893
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-01-24 18:52:39 +00:00
Augustin Cavalier
5b0e5c0ac6 BScrollView: Automatically update the scrollbar proportions in layout mode.
Since we know what size the target view is / wants to be, we can automatically
set the range, steps, and proportion trivially. In non-layout mode, we retain
the old behavior. Applications or views that need custom scrolling behavior almost
certainly will be using BScrollBars directly and not this, so this should not be
"wasted computation" in pretty much any case.

Greatly improves the appearance and UX of the default case of a layouted
view inside a BScrollView.

Change-Id: Ia6ff6ee14df96799c579e15d274fd4c849675577
Reviewed-on: https://review.haiku-os.org/c/892
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-24 18:52:39 +00:00
Augustin Cavalier
2502d45aca BTabView: Change layout constructor to default to B_WIDTH_FROM_WIDEST.
This seems to fit the "spirit of layout" better.

Change-Id: I7a75b58de4c9f703d828cdd292b7b91ee720c135
Reviewed-on: https://review.haiku-os.org/c/891
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-24 18:52:39 +00:00
Augustin Cavalier
23bdc3d636 HaikuDepot: Fix build of unit tests after last commit. 2019-01-24 13:29:45 -05:00
Andrew Lindesay
81dab2139e HaikuDepot : Generate Server Model + Parser
The server uses JSON schema to generate some data-transfer-object (DTO)
models for communication with other systems.  This same schema can be
used to generate the C++ .cpp and .h files for use in HaikuDepot.  So
far these have been generated by hand and then manually added to the
Haiku repo.  Now the schema files can be copied over and from those, the
sources are generated.

Change-Id: Ia288cb7a50843e5e2bc403a6ce55508a04218c04
Reviewed-on: https://review.haiku-os.org/c/858
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-01-24 17:18:05 +00:00
Augustin Cavalier
3288c09996 idualwifi7260: Merge new changes from FreeBSD.
These seem to greatly improve driver stability.
2019-01-23 23:40:46 -05:00
Augustin Cavalier
478aa96dd7 Makefile Engine: Add quotes around INSTALL_DIR.
This is the correct solution to #11419; I missed in my original commit
that $(NAME) will already be escaped, and adding quotes double-escaped
it erroneously.
2019-01-23 23:39:46 -05:00
Augustin Cavalier
ad7cab8751 Haiku Book: Update BFont docs. 2019-01-23 23:10:33 -05:00
Rob Gill
d9b872d03c src/preferences Code formatting
*	No functional change

		code formatting changes only

Change-Id: Id861adea9266a9ccbf9925d36e4a2bad85b640b7
Reviewed-on: https://review.haiku-os.org/c/895
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-23 19:53:25 +00:00
Augustin Cavalier
79456ebd5b libroot: Fix build under GCC 7. 2019-01-22 23:56:59 -05:00
Augustin Cavalier
2b4b201847 libroot: Call abort() only if a signal handler is installed.
Preserving the assert failure message in debug reports is desirable,
so if possible we should do so, not just print it to stderr. So
now we reuse the same trick from abort() directly.

Sorry for the extra noise; I should have combined these commits.
2019-01-22 22:02:59 -05:00
Augustin Cavalier
7282d46cef libroot: Style cleanups in assert.c. 2019-01-22 21:53:08 -05:00
Augustin Cavalier
f52bb5ce10 libroot: Call abort() instead of debugger() from assert().
As per the POSIX specification.

This gives the calling program a chance to catch the assertion. But
in the case where no signal handler is installed for SIGABRT, we
will call debugger() anyway and present as a crash as before.

Fixes #10295.
2019-01-22 21:50:17 -05:00
Augustin Cavalier
f22ee592d6 kernel/vfs: Fix shadowed variables.
The -Werror=uninitialized caught this, but I fixed it the wrong way
rather than looking at the code a little closer.

Should fix the strange bugs that cropped up after the first VFS patch.
2019-01-22 21:37:15 -05:00
Alexander von Gluck IV
7e4621737c mime_db: Add several missing text extensions
* Dog-fooding and keep having to manually open files
  in Pe since the types weren't detected.
2019-01-23 01:37:38 +00:00
lazybullfrog
dace9ead09 Terminal: added argv for initial working directory
Change-Id: I82ea0e358d037d79f2a7ffb59f83cf6e3d72d4a6
Reviewed-on: https://review.haiku-os.org/c/780
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-01-22 17:53:03 +00:00
Augustin Cavalier
3f77fdd1d2 kernel/vfs: Fix -Werror=maybe-uninitialized. 2019-01-22 12:47:07 -05:00
Leorize
cb0d3bd341 kernel/fs/vfs: add truncation check for user_strlcpy calls
**Lots** of syscalls here don't check if strlcpy truncated the user
supplied argument. This commit adds them where appropriate.

Closes #2642

Change-Id: Iff89055aeb3a1870c8baf327b60873ce85815cd7
Reviewed-on: https://review.haiku-os.org/c/890
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-22 17:00:05 +00:00
Augustin Cavalier
a4f5124fcc Media Kit: Rewrite DefaultMediaTheme to use layouts.
The old fixed-rect method was very error-prone in corner-cases,
resulting in half-visible (cut off) parameters, incorrectly
sized controls, etc. on various devices, which often made it
impossible to use.

While there are still a few rough edges (scrollbar behavior could
be further improved, though it's already much better than it was before),
this method is much better than the previous one.

Fixes #11592 and related tickets.

Change-Id: I65175f760bda98e42d1fc68ba8e526470bf17c25
Reviewed-on: https://review.haiku-os.org/c/889
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-01-22 14:25:09 +00:00
Augustin Cavalier
658362336e Media: Don't delete the BLayoutItem when clearing the parameter view.
It is owned by the BView which we delete on the next line; and doing this
triggers an assert if there are still child views, which the BView destructor
cleans up before deleting the layout item.

Change-Id: I2f6f913b963e15c9808328aa2e0581cd1755e8ce
Reviewed-on: https://review.haiku-os.org/c/888
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-22 14:25:09 +00:00
Humdinger
a1f3d79db8 makefile_engine: Revert hrev52738
Reverts hrev52738, as discussed with waddlesplash on IRC.
Re-opens #11419 "makefile_engine's install function fails on paths with blanks"

Turns out this change results in escaped filenames, e.g. "Open Origin Package"
becomes "Open\ Origin\ Package", see
https://github.com/haikuports/haikuports/pull/3580
2019-01-21 16:55:56 +01:00
Murai Takashi
ef916ff3b5 bin/multiuser: Fix PVS 1809 and 1896
Replace memset() with explicit_bzero(), since compiler could delete
memset() funnction call.

Change-Id: I6d6ad991951f516cf94b6fdf1772715ef4a42822
Reviewed-on: https://review.haiku-os.org/c/880
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-21 15:52:19 +00:00
Rob Gill
2876fb7c18 apps/DriveSetup Warn before formatting Intel extended Partition
* Provide a specific warning should a user select formatting the
  intel extended partition. Formatting this partition results in
  the loss of any subpartitions, and results in no usable partition.
  (as described in bug #9856).

Change-Id: I6fb71f3329596217364f3be56b7ca225a1f26441
Reviewed-on: https://review.haiku-os.org/c/886
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-01-21 10:29:50 +00:00
Rob Gill
db578bfa3a apps/AboutSystem NetBSD licences and xfree86 url
* Adds licence information for the NetBSD contributions
	* ftp - 4 clause BSD (retained in ftp.c)
	* tput - Berkeley
	(http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/tput/tput.c?rev=1.26)

* Berkeley licence text added to licences

* xfree86.org url added

  These were previously marked TODOs

Change-Id: I01bf0bb6055b3b45ca80c6cddabdb093cb043408
Reviewed-on: https://review.haiku-os.org/c/887
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-01-20 11:08:30 +00:00
Rob Gill
ff4410ea9d add-ons/kernel/file_systems: additional gpt filesystem types
* Updates list of gpt filesystems which can be recognized
	(no change to operation)

* sources for updated information:
	systemd https://systemd.io/BOOT_LOADER_SPECIFICATION
	microsoft https://docs.microsoft.com/en-us/windows/desktop/api/winioctl/ns-winioctl-_partition_information_gpt
	freedesktop https://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/
	freebsd & vmware https://www.unix.com/man-page/FreeBSD/8/GPART

Change-Id: I5387a8e00f999290632231530dccfaf73831bc9c
Reviewed-on: https://review.haiku-os.org/c/885
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-19 18:38:24 +00:00
Leorize
b9c25b0d0e unistd: introduce nice()
This commit implements nice() as specified in POSIX.1-2008.

Fixes #4932.

Change-Id: Ibd8d4636d9e3a8adf0f26a081d5b1180f0cbb839
Reviewed-on: https://review.haiku-os.org/c/863
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-19 18:31:58 +00:00
Timothy Gu
8ae2e95643 libroot: add [gs]etpriority implementation
Implemented against POSIX-1.2013.

The implementation POSIX requirement thats setpriority() shall affect the
priority of all system scope threads only extends to POSIX threads. This
is implemented by modifying the default attributes for newly spawned
pthreads.

It is not possible to modify the default pthread attributes for different
processes with the current implementation, as default pthread attributes
are implemented in user-space. As a result, PRIO_PROCESS for which and 0
for who is the only supported combination for setpriority().

While it is possible to move the default attributes to the kernel, it
is chosen not to so as to keep the pthread implementation user-space only.

POSIX requires that lowering the nice value (increasing priority) can be
done only by processes with appropriate privileges. However, as Haiku
currently doesn't harbor any restrictions in setting the thread priority,
this is not implemented.

It is possible to have small precision errors when converting from Unix-
style thread priority to Be-style. For example, the following program
outputs "17" instead of the expected "18":

	#include <stdio.h>
	#include <sys/resource.h>

	int
	main()
	{
		setpriority(PRIO_PROCESS, 0, 18);
		printf("%d\n", getpriority(PRIO_PROCESS, 0));
		return 0;
	}

The underlying reason is because when you setpriority() both 18 and 19
are converted to the Be-style "2". This problem should not happen with
priority levels lower than or equal to 20, when the Be notation is more
precise than the Unix-style.

Done as a part of GCI 2014. Fixes #2817.

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Co-authored-by: Leorize <leorize+oss@disroot.org>
Change-Id: Ie14f105b00fe8563d16b3562748e1c2e56c873a6
Reviewed-on: https://review.haiku-os.org/c/78
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-19 18:31:58 +00:00
Augustin Cavalier
a526bddb8d bootloader: Add missing NULL check. 2019-01-16 20:37:07 -05:00
Augustin Cavalier
1fef0f0fa8 bootloader: Use the already-detected filesystem module...
...rather than enumerating again. Solves a TODO (all filesystems
save tarfs and packagefs, which require special parameters and
of course will not be on standard "partitions", have implemented
the required function.)
2019-01-16 20:33:12 -05:00
Augustin Cavalier
450dd5db3a ACPI: Fix -Wunused-but-set-variable. 2019-01-16 19:32:45 -05:00
Augustin Cavalier
20f6556bff kernel/x86: Backslash-escape trigraphs.
Fixes an instance of -Wtrigraphs.
2019-01-16 19:32:16 -05:00
Augustin Cavalier
205beac382 ArchitectureRules: Enable more warnings. 2019-01-16 19:31:58 -05:00
Augustin Cavalier
8fa626d09d XHCI: Refactor register area access and handling.
* Don't bother aligning the PCI memory addresses; they will already
   be aligned, and even if by some mystery they aren't, map_physical_memory
   should be able to handle that. This greatly simplifies the code.
 * Use one pointer and then four different offset fields instead of four
   different pointers. This is what DragonFlyBSD and FreeBSD do; it's
   a negligible loss in performance (or none at all, depending on arch
   and compiler) as it requires only one more add, and greatly clarifies
   the code as to what's going on.
 * Remove (both previously and now) unused fields from the header.
 * Compute runtime and doorbell register offsets correctly (there
   was a missing bitmask.) This is how it's done on FreeBSD and
   DragonFlyBSD.
 * Actually write the high bits of the DMA addresses. Checked against
   FreeBSD and DragonFlyBSD.
 * Tweak error message.

Possibly fixes the "invalid bus space memory access" crash, but
I don't have any hardware that occurs on so I couldn't check.

Tested in VMware, VirtualBox, and on a ThinkPad E550 (Broadwell).
2019-01-16 19:27:41 -05:00
Fredrik Holmqvist
abdd597add Add CACHE_LINE_SIZE for ARM in FreeBSD header
The Haiku headers are C++ and include other C++ ones
2019-01-16 22:35:35 +01:00
Augustin Cavalier
09fa96ee75 settings/drivers/kernel: Reorder to be in more logical groupings.
Also add better descriptions for APM and ACPI.
2019-01-16 15:34:26 -05:00