Commit Graph

60312 Commits

Author SHA1 Message Date
Ryan Leavengood
ecba7b5c7e Tracker: Ensure loading the Node works before passing to a Filter
Checking errors is important. This properly fixes #10365 and resolves a few
TODOs.

This DirectoryFilter is also used in Expander, though with a lower level
implementation that did not trigger this bug. This feels like it could be
in the the Tracker or shared kit.

Change-Id: Icd2ddc241c1879a7c4235726bf089570ba00dc0a
Reviewed-on: https://review.haiku-os.org/c/1672
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-08-02 04:31:43 +00:00
Alexander von Gluck IV
925d9f1909 build/scripts: Add find_triplet to allow easy solving of arch to gcc triplet 2019-08-01 10:36:01 -05:00
Augustin Cavalier
10d876dede Tracker: Add missing close-paren from previous commit. 2019-07-31 18:29:22 -04:00
Adrien Destugues
5bc378608a PVS V1039: useless use of multichar constants
Bitshifts and masks are a lot more readable here.

Change-Id: I94c8603b75d42456843a0b53bf2a0547aaffdb74
Reviewed-on: https://review.haiku-os.org/c/1669
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-31 22:00:53 +00:00
Adrien Destugues
0bc2edbd01 ScreenMode: add some manufacturers
Taken from http://edid.tv/manufacturer/

Mostly so my laptop properly identifies as Seiko Epson.

Change-Id: Ie04cb6593e87f3509a7158948d5ae85b10148fcb
Reviewed-on: https://review.haiku-os.org/c/1668
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-31 22:00:53 +00:00
Augustin Cavalier
69a9cd36e6 kernel/fs: Free file descriptors via put_fd(), not free().
FDs are now object_cached, so this triggered an assert-failure panic
trying to put them through the regular allocator. Just use put_fd
to free these instead, so that there is only one "destruction" path
for FDs.

Fixes #15213.
2019-07-30 23:42:20 -04:00
Augustin Cavalier
399fe9fc1a app_server: Alphabetize new include in MessageLooper. 2019-07-30 23:41:09 -04:00
Adrien Destugues
103741882a PVS V542: operator precedence issue accross macro expansion
In CodyCam, we attempt to cast the result of this macro to const char*.
However, the ternary operator has lower priority than the cast so it
doesn't work as expected.

Add some protective parentheses here.

Change-Id: I5e9875187cec67b9534b1bbe58d82217c6cd5524
Reviewed-on: https://review.haiku-os.org/c/1667
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-31 02:13:01 +00:00
Adrien Destugues
e1633b4220 PVS V536: accidentally octal constant
This bug was inherited from the original XScreenSaver sourcecode:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=575279#10

And is now fixed there:
https://github.com/Zygo/xscreensaver/blob/master/utils/yarandom.c
Change-Id: I08f2d968b76cd0b86291695e2f05e2173c972d05
Reviewed-on: https://review.haiku-os.org/c/1666
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-31 02:13:01 +00:00
Adrien Destugues
679c751309 PVS V529: ; after while
Just rewrite the loop in a more readable way.

Change-Id: I174016eac74eb54a01e5226b5f8a92fb1b335830
Reviewed-on: https://review.haiku-os.org/c/1665
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-31 02:13:01 +00:00
Adrien Destugues
e66c5b32a8 PVS V523: identical code in if/else
Use #if 0 to disable code that should be disabled.

Change-Id: I797383eb8c68681459d8cd56d1b3addda960fa44
Reviewed-on: https://review.haiku-os.org/c/1664
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-31 02:13:01 +00:00
Murai Takashi
cbc96724ab Localize AutoRaise
Change-Id: I3d71aa0691c4d8a59b6e8d4dbb2d7d4e7eab47c9
Reviewed-on: https://review.haiku-os.org/c/1659
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-31 02:11:19 +00:00
Alexander von Gluck IV
459b9916b9 nvme_disk: Disable Boot Symlink on non-x86; #15212 2019-07-30 13:39:19 -05:00
Alexander von Gluck IV
de4406ad8d nvme_disk: Disable on non-x86; #15212
* There are some type-length issues on arm, and our
  usage outside of x86 is limited for the moment.
* This could be fixed in the future.
2019-07-30 11:41:11 -05:00
Adrien Destugues
017d6fb4ad PVS V510: passing struct instead of address to function
Change-Id: Ic81e062e7ddb0d5ea2ef796bb0815f5ec6bf7414
Reviewed-on: https://review.haiku-os.org/c/1660
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-29 21:32:05 +00:00
Adrien Destugues
7bdc1a190c PVS V522: PathMonitor: NULL pointer dereference
Change-Id: I77df9c18960eee0183145441d3a1bd4ceb112147
Reviewed-on: https://review.haiku-os.org/c/1662
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-29 21:31:36 +00:00
Adrien Destugues
4950607607 Add a features.h to auto enable _DEFAULT_SOURCE
Unless __STRICT_ANSI__ is defined (as it is when running the compiler in
--std=c89 or --std=c99, but not when running it without any specific
args), we can enable these by default and behave like most other
systems. I don't know why no one has done this yet despite suggesting it
multiple times and people prefer to #define _BSD_SOURCE manually
everywhere.

Remove all places in our Jamfiles and sources where it had been defined.
_DEFAULT_SOURCE is now enabled by default for all sources of Haiku, since we
let the compiler use GNU extensions (no strict C standard specified on
command line)

Use _DEFAULT_SOURCE as the define name to match current versions of
glibc. Enable it if _BSD_SOURCE is #defined in compiler flags, for
backward compatibility.

Change-Id: I6db04da5f6db437723cdfba3478f5094a69d7727
Reviewed-on: https://review.haiku-os.org/c/1633
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2019-07-29 20:26:46 +00:00
Jérôme Duval
70e55f0046 autoraise: fix debug build.
Change-Id: I8ee35807eab8252dcb2399734fc5831f2b50690f
Reviewed-on: https://review.haiku-os.org/c/1657
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-28 20:34:23 +00:00
Augustin Cavalier
14b62ae4da BFS: Make the log-flusher thread persistent.
Previously, a new log-flush thread was created every time there was
an idle transaction. Now we just release a semaphore for an
already-existing thread.

Change-Id: If788dbe17ef8e069ce12aa7b778626d051cce2d0
2019-07-28 16:29:02 -04:00
Augustin Cavalier
1bb19993c0 app_server: Include malloc.h to appease GCC2. 2019-07-28 15:31:11 -04:00
Augustin Cavalier
206846d0f5 fs_shell: Add stub wait_for_thread.
We already have a dummy spawn_kernel_thread, so this makes sense to add
(and will be required by the next commit.)

Change-Id: Ic46607d46dabc6fd46fcfc0b6f8da0ed9897cfc9
Reviewed-on: https://review.haiku-os.org/c/1650
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-28 19:15:07 +00:00
Augustin Cavalier
bae7a949c5 app_server: We must clone the name in MessageLooper().
A number of things that pass it in have it as a stack temporary.
2019-07-28 15:03:42 -04:00
Augustin Cavalier
1b333570b5 app_server: Use RW_LOCK_FLAG_CLONE_NAME in MultiLocker.
This behavior was always used by the semaphore-based MultiLocker,
and it seems a good chunk of code depends on this, so we need
to preserve the behavior.
2019-07-28 14:54:25 -04:00
Humdinger
f5cdaacd20 Minor GUI string changes
HaikuDepot: change BAlert title
DriveSetup: capitalize Mimes -> MIMEs
2019-07-28 20:09:54 +02:00
Jérôme Duval
b1a92c722b usb_serial: make buffers kernel-only for SMAP, see #15172.
Change-Id: I11ea1e18977331a513bf97f5ce885f608e9b573a
Reviewed-on: https://review.haiku-os.org/c/1654
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-28 12:21:58 +00:00
Adrien Destugues
bed5fd2984 TRoster: fix always false condition, again.
Change-Id: I5f43a9c60c329dbce5ab1344692877a538053af9
Reviewed-on: https://review.haiku-os.org/c/1653
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-28 12:21:19 +00:00
Adrien Destugues
b70baf6c5e PVS V501: redundant check
The wewant macro already checks this.

Change-Id: I9a92c8acb4e1a0cc2ef4b520383160d640a2bd94
Reviewed-on: https://review.haiku-os.org/c/1656
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2019-07-28 10:52:20 +00:00
Adrien Destugues
b0890e034b PVS V501: comparing number with itself
I assume the intent was the same as in other similar functions above.

Change-Id: I887cd73d846680a5a5ec5c90f678ad4b12122eb3
Reviewed-on: https://review.haiku-os.org/c/1655
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2019-07-28 10:16:43 +00:00
Augustin Cavalier
fd97a8c7fe app_server: Use a rw_lock instead of 3 (!) semaphores for MultiLocker.
Since every HWInterface is a MultiLocker, and every BBitmap requires
a server-side BitmapHWInterface, this saves 3 semaphores per BBitmap
instance (as well as a lot of semaphore-related overhead in calling
the kernel so often.)
2019-07-27 23:53:45 -04:00
Augustin Cavalier
f9c77b11ed app_server: Clean up MultiLocker::IsWriteLocked().
This function was (or at least now is) severely over-engineered:
it is designed to avoid calling find_thread(NULL) as little
as possible, and use stack addresses to determine if the current
thread is the one holding the write lock.

However, this is unneccessary, as find_thread(NULL) has been
optimized (on x86 and x86_64, at least) to be a single "mov"
from thread-local data, with no syscall. So that is probably
even faster than an integer divide and compare, allowing
this function to be simplified greatly.
2019-07-27 23:06:24 -04:00
Augustin Cavalier
359cf10594 registar: Revert part of 6967695c4e.
This broke the function, making all apps that wanted the list,
e.g. Deskbar, ProcessController, etc. simply not display teams.
2019-07-27 22:21:04 -04:00
Augustin Cavalier
1e8a3588cd libbe_build: Use a copy of the BLocker sources.
My upcoming changes to use our "futexes" instead of semaphores
will obviously not work on non-Haiku platforms, so we now
need a copy of this class in libbe_build.
2019-07-27 18:33:47 -04:00
Augustin Cavalier
3c2901a976 libroot: Expose the internal mutex_lock for private consumption. 2019-07-27 18:32:18 -04:00
Augustin Cavalier
565155afa1 Remove unnecessary usages of BLocker::Sem().
Most of these should have been BLocker::InitCheck() anyway.
The one that was actually using the sem (MessageLooper)
should just store the name parameter, which simplifies
things anyway.

Done as a result of a branch where I'm experimenting
with making BLocker not even create a semaphore in
"benaphore" mode.
2019-07-27 18:31:58 -04:00
Augustin Cavalier
bbee879291 kernel/system_info: Restore the previous cpuCount check.
As per axeld's review; the change was unnecessary.
2019-07-27 17:09:43 -04:00
Augustin Cavalier
68d11f88e9 kernel/system_info: Check bounded "count" instead of the unbounded one.
This condition should never be hit by well-behaved applications
anyways.
2019-07-27 13:51:46 -04:00
Augustin Cavalier
538a30f8db XHCI: Fix use-after-free in FreeDevice.
Spotted by PVS-Studio.
2019-07-27 13:17:35 -04:00
Augustin Cavalier
32f97c7c1e registrar: Add missing initialization of error.
Spotted by korli.
2019-07-27 13:00:38 -04:00
Augustin Cavalier
46511867cc IMAP: Correct typos and translate more strings. 2019-07-27 12:57:13 -04:00
Autocomitter
d8d7f0ae9d Update translations from Pootle 2019-07-27 15:47:36 +00:00
Murai Takashi
122d4ef7e9 PVS V595: Pointer was utilized before it was verified against nullptr.
Change-Id: Iba8b7e6160dc237f45080fa7c101fa72e4d8c753
Reviewed-on: https://review.haiku-os.org/c/1643
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-27 15:22:15 +00:00
Zoltán Mizsei
3ddf0bbc29 BSD: Use elf.h from os/kernel
Platform-dependant defines for Elf_*

Change-Id: Ib86554eb497d20e60ad7c75de4321d5b516ad88c
Reviewed-on: https://review.haiku-os.org/c/1635
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-27 15:19:31 +00:00
Adrien Destugues
6967695c4e PVS V547: always false comparisons
Change-Id: I1c7790ff0aa537b974bdc0fd65d76f277ea5f8cf
Reviewed-on: https://review.haiku-os.org/c/1647
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-27 15:16:31 +00:00
Murai Takashi
84a5d9f625 Keymap: localize system keymap list
Change-Id: Ifd8e7c2b4a8d1f48ce31686b3b653d0304b4c635
Reviewed-on: https://review.haiku-os.org/c/1649
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-27 15:14:56 +00:00
Adrien Destugues
490df7cbfd Input: improve layout
Put some margins around the main view
2019-07-27 13:15:17 +02:00
Adrien Destugues
a79976efc2 Input preferences: fix build
One file was accidentally missing from this commit and was added to the
next one (which isn't ready for merging yet). Add it back here instead.
2019-07-27 13:15:17 +02:00
Dancsó Róbert
fc8ec82116 DriveSetup: vizualize more information
- Show a lock for encrypted partitions (bitlocker, pgp, safeboot, luks)
- Show icons for boot, shared, virtual or read-only partitions
- Use different colors for boot, bfs, encrypted partitions
- Show partition usage in visual overview (only for mounted volumes)
- Add more infos in the parameter column
- Add columns with free space and block size

Fixes #10098 (as mentionned there, TrueCrypt/DriveEncryption can't be
detected)

Change-Id: I44914bacfabadaec4f862c8816f9575dc9617798
Reviewed-on: https://review.haiku-os.org/c/1399
Reviewed-by: Kacper Kasper <kacperkasper@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2019-07-25 19:17:23 +00:00
Adrien Destugues
61be57c0e6 PVS V678: wrong argument passed to function
Change-Id: I6fcc1caea8396185db74a8784975c561e31fab3f
Reviewed-on: https://review.haiku-os.org/c/1646
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-25 00:10:08 +00:00
Adrien Destugues
57657d2241 PVS V705: suspicious else clause.
Change-Id: I8e65aed551b77d114cadb93e3e2c308eadd307c6
Reviewed-on: https://review.haiku-os.org/c/1645
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-25 00:10:08 +00:00
Murai Takashi
b261a89808 HaikuDepot: Add files to DoCatalogs for localizing more text.
Change-Id: I5bbb00b0aea51c899a0cc4efeb6028e9441e50d4
Reviewed-on: https://review.haiku-os.org/c/1648
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-25 00:09:25 +00:00