Commit Graph

60346 Commits

Author SHA1 Message Date
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
Preetpal Kaur
5e9685caa8 Completed Mouse and Touchppad preferences
Complete working and view of pointing devices(mouse and touchpad).

Resolve some issues.
Added the Jamfile

Change-Id: I4db021cb8c63971e5af60bd254c8b3b588d023e9
Reviewed-on: https://review.haiku-os.org/c/1426
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-07-23 15:16:01 +00:00
waddlesplash
698c471f17 kernel/sem: Restore interrupts-unlock before free(). 2019-07-22 20:41:00 -04:00
Adrien Destugues
58db38ed74 bsd/sys/param.h: add NBBY define
This defines the number of bits in a byte and is used in tnftpd.
Once this is merged, some patches to tnftpd can be removed.

Change-Id: Ie2d0c61ce1371daeeb8549281f4210147fb77197
Reviewed-on: https://review.haiku-os.org/c/1642
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-22 23:43:04 +00:00
Adrien Destugues
c0daed76e1 ftp: remove from sources.
Now provided in the tnftp package.

Change-Id: I862b1ff98586aa0e5a9418cf26e30b7136140249
Reviewed-on: https://review.haiku-os.org/c/1641
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-22 23:43:04 +00:00
Augustin Cavalier
c5ec5c0c38 XHCI: Implement isochronous transfers support (!!).
Only out-bound isochronous transfers are tested right now, but in
theory inbound ones "should" work just fine, too. The frame calculation
has a bunch of TODOs around it, because I'm probably not doing it
entirely correctly...

But hey, I made this commit while listening to some glitchy (audio
only in left channel, strange pops occurring intermittently, but
otherwise it sounds 100% correct) music over my USB audio device!
(I'm willing to blame the above problems on our rather buggy
usb_audio driver.)
2019-07-21 23:22:50 -04:00
Augustin Cavalier
a3dca2984d XHCI: Make CancelQueuedTransfers logic much more robust.
* If we fail to stop the endpoint: don't leave things in a valid
   but broken state (i.e. the "used" field will get 'leaked', which may
   prevent transfers from occurring in the future.)
 * Free transfers when cleaning up the endpoint, to avoid memory leaks.
 * A few other miscellaneous cleanups.

My work-in-progress isochronous support seems to trigger instances
of the StopEndpoint command either failing or taking longer than
our timeouts allow, so maybe this will improve things enough for things
to work just a bit more.
2019-07-21 22:53:39 -04:00
Augustin Cavalier
0a564c2cc0 kernel/sem: Drop GRAB macros in favor of SpinLockers.
No functional change intended.

Change-Id: I24f6f8c55b18f8d031d0b5a87672cc969e141577
Reviewed-on: https://review.haiku-os.org/c/1636
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-21 21:14:40 +00:00
Adrien Destugues
91ec679f17 PVS V1010: access before start of buffer after fgets
Change-Id: I8cfa1e8a3c8dd8c2837e51756ac3eeaea1e756f0
Reviewed-on: https://review.haiku-os.org/c/1639
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-21 20:05:08 +00:00
Adrien Destugues
a63a6eb9bc PVS V1022 throwing exceptions by pointer
Change-Id: I0767da0be63a2955cc370ee81dc921cdf101285e
Reviewed-on: https://review.haiku-os.org/c/1638
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-21 20:05:08 +00:00
Murai Takashi
319c399d61 PVS V739: EOF compared with a value of the char type.
Change-Id: Icfaff590359381fbdd3bbd7993dab92111da3ed1
Reviewed-on: https://review.haiku-os.org/c/1618
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-21 15:47:48 +00:00
Adrien Destugues
194c483884 Move SettingsHandler to libshared
It's used by both Tracker and Codycam and others might find it useful.

Change-Id: I585d3a1bdc7f8fce7d36bedf6867464cd541ba2e
Reviewed-on: https://review.haiku-os.org/c/1637
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-21 15:47:48 +00:00
Autocomitter
d63cb7c8db Update translations from Pootle 2019-07-21 08:11:11 +00:00
Calvin Buckley
f093894af1 Fix Zen-based (family 0x8f) CPU naming
Previously, it identified all Zen CPUs as Ryzen 7. Since the model
and stepping information consist of microarchitecture information
and don't carry the model number, use the parse_amd based name,
which will remove any unnecessary details from the returned name.

Fixes #15153.

Change-Id: I1a20bf35a60b2fdd20d4cc90ec2dd95fd0e6439d
Reviewed-on: https://review.haiku-os.org/c/1634
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-20 16:07:58 +00:00
CodeforEvolution
e1a822a95f Conform putenv to POSIX standards
Discovered this while working on VLC, checked with other online sources too.

Change-Id: I114c20babda0ff0e90d0eeee299d8483700166bd
Reviewed-on: https://review.haiku-os.org/c/1628
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-07-20 16:02:00 +00:00
Augustin Cavalier
736adc5a11 XHCI: Tweak formatting of FinishTransfers logic.
No functional change intended.
2019-07-20 09:52:14 -04:00
Augustin Cavalier
2f044f2aa7 XHCI: Check return status of PrepareKernelAccess.
Potentially fixes #15172.
2019-07-19 21:07:29 -04:00