Commit Graph

50037 Commits

Author SHA1 Message Date
Murai Takashi
8a8e01bf41 strfmon.c: Fix -Wpointer-compare
Fix comparison between pointer and zero character constant.
Pointed out by gcc7.

See also: 3d4c1b73b9

Change-Id: I917ceefce69e269fbaa12a3ae60f0702f5c5d4a7
Reviewed-on: https://review.haiku-os.org/782
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-21 17:10:24 +00:00
Murai Takashi
be27cf7649 accelerants/common: Fix PVS 1116, 1117
Fix there are two 'if' statements with identical conditional expressions.

Change-Id: I3396d4e34b70dd293957a892cd603033d6664699
Reviewed-on: https://review.haiku-os.org/789
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-21 17:09:42 +00:00
Axel Dörfler
949a1ff7cc net_server: Documented suggested interface behavior
* Also simplified updating the interface message with SetString().

Change-Id: I29635cba5ddde693f6b7b97b8bd01769b02919d5
Reviewed-on: https://review.haiku-os.org/788
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-21 08:30:25 +00:00
Axel Dörfler
a0efb75a5c net_server: Configure devices not found in settings
* Previously, the assumption was that your settings would configure
  all devices.
* Now, all devices that are not covered by the "interfaces" settings
  file will be automatically configured.
* This fixes ticket #6423.

Change-Id: Ib1e0c70314dc27cde14a00601fc8045d32937dfd
Reviewed-on: https://review.haiku-os.org/787
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2018-12-21 08:29:04 +00:00
Murai Takashi
cdb7e8177d media-add-ons/multi_audio: Remove unneed menset()
Remove unneed menset(), since media_format already use memset()
in its constructor.
Also fixes -Werror=class-memaccess pointed out by gcc8.

Change-Id: I3283417323550492799a34a2d29cdad03a82a2d5
Reviewed-on: https://review.haiku-os.org/783
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-20 09:00:31 +00:00
Augustin Cavalier
a62458c79c runtime_loader: Export the correct reinit_after_fork.
Forgot to add this change in my last commit. Whoops.
2018-12-19 21:43:11 -05:00
Fredrik Holmqvist
08c9948c20 Upgrade ACPICA to 20181213: a lot of bug-fixes 2018-12-19 21:19:25 +01:00
Axel Dörfler
339eef5131 Revert "net_server: Add (more) missing devices even if one has already been found."
This reverts commit def61273ed.

This isn't a fix for the issue, it will just throw away all settings.

Change-Id: I2979c02c54f9379f25dc5d41d3a6085c09e87ac3
Reviewed-on: https://review.haiku-os.org/785
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2018-12-19 12:35:15 +00:00
Augustin Cavalier
3256001041 runtime_loader: Reinit the heap lock after fork. 2018-12-18 18:01:09 -05:00
Murai Takashi
296120e005 MediaPlayer: Fix -Werror=format-truncation=
Increase size of text[], since snprintf() write to it max 66 bytes.
(sizeof(positionText)-1 + sizeof(" / ") + sizeof(durationText)-1 + 1 = 66)
Pointed out by gcc8.

Change-Id: Ic6ce221edb4ceff4b63c7b30d26c52d613cbb35e
Reviewed-on: https://review.haiku-os.org/779
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-18 18:37:14 +00:00
Humdinger
947124d152 Mail: Add queries for same subject, sender, recipient
In the "Queries" menu, add three items at the top to start a query
for the same recipient/sender/subject as the current email. Move the
separator and "Edit queries..." item to the bottom of the menu.

The temporarily created queries are put into B_USER_CACHE_DIRECTORY/Mail/.
The data in those queries might be private, therefore not in system /tmp.

The queries use the DefaultQueryTemplates for x-email, if that exists. This
is done by copying all the template's attributes. Code for that borrowed from
'copyattr'.

When creating a query for the same subject, use the MAIL:thread text for
the search, as that doesn't contain stuff like "Re: Re: Fwd: Re...". Do
the query for MAIL:subject though, because sent emails don't have a
MAIL:thread attribute.

Change-Id: I23b46f3ec07760d17b076d8b8aa8839c5f88963f
Reviewed-on: https://review.haiku-os.org/768
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2018-12-18 05:45:13 +00:00
Augustin Cavalier
5e621d3edd tests/posix: Add tls_concurrency_test.
From #14342. Crashed before the last commit, now works. Disabled because
it won't build under GCC2.
2018-12-17 20:09:27 -05:00
Augustin Cavalier
df3de4792e runtime_loader: Make the heap thread-safe.
Previously we didn't need to care about threading in here, as it
was used only up to the point where the application's _start was called
and then libroot's heap would take over. But with the introduction of TLS
support by pdziepak in 2014, we also handle TLS bookkeeping inside
runtime_loader, and so this heap needs to be thread-safe.

Properly fixes the JVM crashes korli was attempting to fix in hrev52658,
and fixes #13154, #14129, #14304, #14342 for real.
2018-12-17 20:03:47 -05:00
Augustin Cavalier
e7d37c7e08 Revert "runtime_loader: Add missing locking around resizing the TLS DTV."
This reverts commit d0111efead.

Initially, I, too thought this was the correct solution. In
investigating the related #14342, I found that adding a lock of
the mutex in the function that crashed most often in (DestroyAll())
increased the time it took to cause a crash from 1-2 seconds
to 10-15 seconds, but it still inevitably crashed.

Further, crash addresses were often very low (e.g. 0x1, 0x18); on
inspection I determined these were coming from the fPointer fields
of TLSBlocks. But accesses to TLSBlocks were now well protected
by the TLS mutex, and they were memset'd after allocation, so that
didn't make any sense.

At that point, I went back and read over the code until I understood
it, and it became clear this solution was incorrect: TLSBlocks and
their underlying data are always associated with a specific thread,
meaning _Resize() and DestroyAll() would never be called on the same
data from different threads, despite appearances to the contrary.

Thus despite a dearth of comments in this file, it seems pdziepak
knew what he was doing when he wrote this; no locking is needed.
That left only one place to cause this kind of memory corruption...
2018-12-17 19:52:49 -05:00
Danc2
def61273ed net_server: Add (more) missing devices even if one has already been found.
Fixes #6423 and helps with #14626.

In BringUpInterfaces, line 772 creates an error which only adds a missing
interface if one does not already exist (i.e., !_testInterface()). This can lead to
a missing WiFi interface if an Ethernet connection has been configured and set in
the /boot/system/settings/network/interfaces before the WiFi has had a chance to
be added to /dev/net. To properly configure a missing device, such as a WiFi
connection, and allow the user to choose amongst configured interfaces (i.e.,
add it to the list of devices in /dev/net and e.g., see WiFi as an option),
removing the 'if' statement on line 772 is necessary.

Two edge cases may arise:
1. A user may disable an interface -- don't add device
Solution: The code currently handles this. _ConfigureInterfacesFromSettings, called
at line 746, checks for interfaces in fSettings to see if they are disabled (706-711).
If so, they are disabled and not set as a missingDevice if the interface is disabled
(709). The next interface is checked... etc.

2. Devices must not be added twice (i.e., Checking for An Existing configured Network)
Solution: The code currently checks for this. On lines 716-720, a device that is found
in fSettings (missingDevice), is set to the interface which is later added to the
/dev/net within that (unnecessary?) if statement (772). The missingDevice will only
be set and added to /dev/net if an entry does not exist in the settings already (716)
(hence the identifier missingDevice).
Change-Id: Ifc303371b88f18c30141a651a7d97a3c860e864f
Reviewed-on: https://review.haiku-os.org/767
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-17 22:46:08 +00:00
Andrew Lindesay
3369e03d5c HaikuDepot: Process and Data-loading Improvements
This change is a reshuffle of the backend processing involved in the
aquisition of data from servers including the pull-down and load of
HPKR data as well as the pull-down and load of data from the
HaikuDepotServer (HDS) system.  The driver for this change is to
implement an initial implementation of a progress bar for the
loading of data as the application starts.

The following are notable changes;

* Removed some previously attempted 'functional style' logic in the
  model which didn't fit well with C++
* Use of the base-url in the logical mapping from HDS and HD data is no
  longer required and has been removed
* Some logging has been improved making it clearer which part of HD
  is producing the logging which in turn helps with debugging issues
* List class has been modified to more cleanly support sorted lists
  and binary searches; tests have also be updated accordingly
* Reorganise and tidy-up of the data-loading processes' structures
* The local repository update (HPKR) and data-load occur in background
  processes now in the same system as the HDS data-load - this has been
  crudely shifted from the MainWindow to new Processes and incorporated
  into the background processing system
* The 'state-machine' background process runner is now replaced with a
  'coordinator' style approach that can more easily handle the new
  processes related to HPKR loading.
* Progress for loading processes is shown in the main window in the
  WorkStatusView - this is flickering a bit, but basically works
* Added some documentation regarding how Processes work in the system
* The "Refresh Repositories" menu item now also updates data from HDS
* The "Refresh Repositories" menu item is disabled when the background
  processes are running that update the repository data

Some further refinement would be good, but this change is large enough
for one round of improvements.  There is an issue that the status bar
is used for screenshot display as well as this data-loading, but that
was the case before so it is something that can be dealt with later if
it is a problem.

Change-Id: I7668307645e3aabaf7e4a6e37e2cca80cc0f489e
Reviewed-on: https://review.haiku-os.org/770
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-17 19:31:25 +00:00
Owen
1609bb2f67 Mail: Fix infinite loop in FindURL.
Fixes #14746.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
One minor change from owenca's original patch: we can't return
immediately if urlString is NULL, as the caller probably wants
the urlLength.
2018-12-17 13:45:33 -05:00
Jérôme Duval
d0111efead runtime_loader: Add missing locking around resizing the TLS DTV.
* Fixes crashes when the DTV is concurrently resized by multiple threads.
* Fixes JVM crash or endless loop when building OpenJDK.
* Should help with #13154, #14129, #14304, #14342.

Change-Id: I132600315d76a1a86236c6c70db09a3cdf0a8743
Reviewed-on: https://review.haiku-os.org/771
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2018-12-17 18:20:45 +00:00
Augustin Cavalier
6109c51d55 idualwifi7260: Add another NULL check before memset. 2018-12-16 22:51:49 -05:00
Augustin Cavalier
a07f133e5b KPath: Prevent setting a KPath to itself causing use-after-free.
SetTo frees the buffer before setting it to the new one,
but if KPath sets itself to ... itself, then it will of course
try to access the buffer again.

Spotted by clang-analyzer (amidst quite a few false positives,
so this doesn't seem like an especially good rabbit hole
to go down right now.)
2018-12-16 22:29:29 -05:00
Augustin Cavalier
514bace91d keymap: Allocate BApplication on the heap.
Avoids triggering an assert at program exit.
2018-12-16 19:35:04 -05:00
Augustin Cavalier
324336d1ed libbsd: Update vis and unvis from FreeBSD.
Fixes #11061.
2018-12-16 18:32:55 -05:00
Augustin Cavalier
18016b9654 broadcom440x: Add missing NULL check.
Fixes #4293 (again.)
2018-12-16 17:14:46 -05:00
Humdinger
b3fd8cd82a TextSearch: don't hard-code Pe editor
When double-clicking a result in TextSearch, it opens the file with
the preferred application for that file type. In case you search
through e.g. a HTML file, that would be most probably WebPositive,
which is not what you want normally.

TextSearch has the setting "Open files in Pe" which forces all files
to be opened in the Pe editor.

With this change, it will force the files to be opened in the
preferred app for text/x-source-code.

Change-Id: I0920a5f2497c01b16be0ac7563fbab942b67ef24
Reviewed-on: https://review.haiku-os.org/769
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-16 17:36:19 +00:00
Augustin Cavalier
9effbd7e00 Remove some unused cruft from the early days.
These lines were added in 2002...
2018-12-15 20:26:13 -05:00
Augustin Cavalier
707c912e12 Tracker: Remove "launch broken link" cruft.
As the comment says, this was a pre-R5 (!) hack for Be's CIFS driver.
2018-12-15 18:11:20 -05:00
Augustin Cavalier
a99aa113de Installer: Check return value of system() calls.
Solves a TODO.
2018-12-15 17:52:23 -05:00
Augustin Cavalier
72fa4a2e5e Installer: Check return value of GetMountPoint.
Probably fixes #14586 (NULL dereference in the strcmp on the next line)
but I couldn't quite manage to reproduce it.
2018-12-15 17:52:08 -05:00
Augustin Cavalier
901de869a3 BDirectory: Rewrite some functions for clarity.
No functional change intended. Whoever wrote these functions before
seems to have been allergic to more than one "return" statement
in a function...
2018-12-14 18:56:53 -05:00
Augustin Cavalier
26d14a317c BDirectory: GetNextEntry() should unset entry when one is not found.
Fixes #1692.
2018-12-14 18:48:38 -05:00
Murai Takashi
e000ae2c88 bin/notify: Fix PVS 741
Fix 'bitmap' is assigned values twice successively.

Change-Id: I02d70a581a682607f6ed280b71cc33c54738b343
Reviewed-on: https://review.haiku-os.org/766
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-14 22:52:42 +00:00
Murai Takashi
e3af9ff0bf kits/tracker: Fix PVS 923
Fix 'entry' is assigned values twice successively.

Change-Id: I86456bf156eb48f3966439a854256e27ee87caaf
Reviewed-on: https://review.haiku-os.org/765
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-14 22:52:42 +00:00
Murai Takashi
3fb9ab7fb6 bus_managers/firewire: Fix PVS 396
Fix 'info' is assigned values twice successively.

Change-Id: I981d3176a41a5f7616ef5a20dae889f1f01525bd
Reviewed-on: https://review.haiku-os.org/764
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-14 22:52:42 +00:00
Adrien Destugues
16a54a87fd Merge usb_floppy back into usb_disk.
- USB pen drive seems to still work. More extensive testing welcome.
- USB floppies don't work yet, but they don't work anymore with the
  current driver, either. I'm still investigating that part.

Fixes #9276

Change-Id: I8aa5ab828ad2ad867d0c187062d6e179372fc2ad
Reviewed-on: https://review.haiku-os.org/747
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-14 22:51:44 +00:00
Peter Kosyh
6fa279737e IMAP: sync fixes
This patch should fix:

- deadlocks while manual syncing/shutdown;
- crashes while manual syncing/shutdown.

Change-Id: I0962ff5580c19cbf740d002b6f62681ed5f558ab
Reviewed-on: https://review.haiku-os.org/758
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2018-12-13 09:32:35 +00:00
Augustin Cavalier
e7e7a55250 kernel/fs: Account for vnode being NULL in vfs_release_posix_lock.
When the FD is put() but not freed while O_DISCONNECTED, its "ops"
and "vnode" are cleared. Thus it is entirely valid for a non-NULL
file FD to have a NULL vnode, so we should just treat such FDs
as if the locks had already been cleared (which they should have.)

Fixes #14294.
2018-12-12 19:24:59 -05:00
Augustin Cavalier
bee962a25e kernel/fs: Consumers of context->fds[] must check O_DISCONNECTED.
Since these do not go through get_fd, which would check for them,
we need to do these checks manually in the relevant locations.

Some of these changes were broken out from axeld's original commit,
and some were found by my own auditing.
2018-12-12 19:05:14 -05:00
Augustin Cavalier
64d1636fea kernel: Rework the FD disconnect feature (again).
axeld's solution from 2015 worked in that it solved the panics and
problems with leaking FDs ... but only if nobody actually tried to
use the FDs again. As you can see in the diff of the previous commit,
in allowing closed FDs (which have NULL "ops") to be returned by get_fd,
all consumers of the get_fd API (so, pretty much most functions in
vfs.cpp and fd.cpp) have to check *both* that (1) the fd is not NULL,
and (2) the fd does not have O_DISCONNECT set.

Besides missing a large majority of consumers of get_fd (which caused
ticket #14532 and also the first half of ticket #14756, probably among
others, as I haven't reviewed all NULL-dereference-in-VFS tickets yet)
this solution missed the fact that calling get_fd increments the reference
count, but then exiting the exact same way as if the FD was NULL
(without putting it) when it is disconnected *also* leaks the FD.

As it turns out, a not insignificant number of applications try
to do this, which (depending on whether you went through one of the
'lucky' functions axeld's commit touched) either (1) leaked the FD,
or (2) caused a kernel panic.

Now, we could go through and add O_DISCONNECT checks to every single
consumer of get_fd followed by put_fd to get the proper behavior ...
but that would be the same thing as just returning NULL here and not
incrementing the reference count.

So it seems the first part of axeld's solution (don't set open_count
or ref_count to -1 but leave them as-is) is the only change necessary.

A few places where there were legitimately missing O_DISCONNECT checks
(some originally added by axeld) are (re-)added in the next commit.
Otherwise this seems to be the more robust solution. (But I wonder why
nobody caught this in the code review axeld asked for in the commit
and the ticket back in 2015? Did nobody notice the unbalanced get/put?)

Fixes #14532, part of #14756, and probably any other NULL dereferences
in VFS I/O functions (XHCI is especially good at exposing these)
that are lingering around on the bugtracker.
2018-12-12 18:42:03 -05:00
Augustin Cavalier
15ec0b5cc8 Revert "VFS: Slight rework of the FD disconnect feature."
This reverts commit eb62d3337b.
2018-12-12 18:40:04 -05:00
Augustin Cavalier
675e5dfcac Mandelbrot: GCC2 fix. 2018-12-12 18:13:18 -05:00
kerwizzy
e5aeaa8d03 Mandelbrot: Implement subsampling
* Added subsampling. This makes the render look less noisy and generally nicer.

Change-Id: I1dd667c8799bd97fb84e1401976da12ecf74ea8c
Reviewed-on: https://review.haiku-os.org/732
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-12 22:17:24 +00:00
Murai Takashi
2e7e161dfb drivesetup: Fix PVS 832
Fix 'parentRow' is assigned values twice successively.

Change-Id: I57a1dec60f651c49eb05f3038b62c49c29eb2ff0
Reviewed-on: https://review.haiku-os.org/763
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-12 22:07:19 +00:00
Murai Takashi
9d9ca63110 glibc: Fix -Wheader-guard
Fix typo in header guard, pointed out by clang.
See also https://sourceware.org/git/?p=glibc.git;a=commit;h=9947638d74f490b8ec9a1563c195881a4151bd80

Change-Id: I6e01c67ed246d4be48463abc490bbb9ba4c76342
Reviewed-on: https://review.haiku-os.org/762
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-12 22:06:23 +00:00
Murai Takashi
382eca52a2 zipomatic: Fix PVS 1103
Fix 'status' is assigned values twice successively.

Change-Id: I348799db32342f0642dac89a62a518d21ef11c34
Reviewed-on: https://review.haiku-os.org/761
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
2018-12-12 21:31:56 +00:00
Murai Takashi
b6766af3e6 cortex: Fix PVS 1504
Fix 'r' is assigned values twice successively.

Change-Id: Ia46786badb1235f16c42e09eb9e9fb750fb2bf29
Reviewed-on: https://review.haiku-os.org/760
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
2018-12-12 21:31:53 +00:00
Augustin Cavalier
67f185ecf5 kernel: Don't retry or wait for the low_resource handler.
As axeld pointed out on the mailing list, map_backing_store is called
with the address space write-locked, and so the resources won't be
released until after we return.

Due to the state we are in at this point, unlocking the address space
before making this call would be likely be very dangerous, and so
simply issuing the notification and then returning an error is all
we can safely do here.
2018-12-12 10:55:43 -05:00
Murai Takashi
07af264afa ipv4: Fix PVS 2464
Fix using local variable within a loop with a same name
as a variable controlling this loop.

Change-Id: Ie920807a56e51b32844ac13ff1d8c564466d3a83
Reviewed-on: https://review.haiku-os.org/751
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-11 19:51:20 +00:00
Augustin Cavalier
f1e8678942 kernel: Notify low resource handler & retry when low on kernel address space.
Solves a decade-old TODO. This might help with strange behavior in
low-memory conditions.
2018-12-11 14:44:52 -05:00
Augustin Cavalier
0a347c90d5 kernel: Minor style cleanup to arch_altcodepatch.
No functional change intended.
2018-12-11 13:38:13 -05:00
Augustin Cavalier
8a1709b3af vm: Allow W|X before kernel startup ends.
The altcodepatch mechanism needs to overwrite parts of the kernel
image. This can't be done by setting it to RW-only and not RWX,
as we are already running within the kernel when this occurs,
and so instruction fetches can and will occur between the points
of +W and -W.

As gKernelStartup is turned off before the scheduler is started,
this is not much of a lifted restriction, as no modules are loaded,
no secondary threads started, etc.

Fixes #14751.
2018-12-11 13:37:39 -05:00
Augustin Cavalier
08858e10fa kernel_cpp: Don't import all of the "std" namespace.
This file is included, directly or indirectly, by most of the
kernel-space C++ code, and so importing the entirety of "std"
seriously pollutes the global namespace.

So instead, just import "std::nothrow", which is the only thing
we really want in the global namespace. Tested on both GCC2
and GCC7 and seems to work just fine.

While I'm here, also update the include guards and copyright
header to match the standard format used elsewhere.
2018-12-10 19:44:07 -05:00
Augustin Cavalier
cac9cf1565 kernel: Staticize id_generator's GeneratorList object.
Spotted by Clang.
2018-12-10 19:17:08 -05:00
Augustin Cavalier
8844a67e90 More trivial syntax and logic cleanup.
Spotted by Clang. No functional change intended.
2018-12-10 19:16:19 -05:00
Alexander von Gluck IV
b279d6def1 busses/mmc/sdhci_pci: Return B_UNHANDLED_INTERRUPT at end of non-void func
* I'm making an assumption here this is the desired result since interrupts
  are unhandled at the end of the function.
* Pointed out by gcc
2018-12-10 16:01:07 +00:00
Augustin Cavalier
4089701dbd interface: Remove some unreachable "break"s.
Spotted by Clang.
2018-12-09 23:04:45 -05:00
Augustin Cavalier
ee0b0d6dac kernel: Fix typos in documentation.
Spotted by Clang (yes, there is a -Wdocumentation that understands
how to parse Doxygen comments!)
2018-12-09 23:04:00 -05:00
Augustin Cavalier
5d78c2d7e0 kernel: Remove some unused macros.
Spotted by Clang. (I double-checked they weren't used within
some #ifdef'd-out code, too.)
2018-12-09 23:03:11 -05:00
Augustin Cavalier
bc3fc95ff6 kernel: encode_glyph shouldn't be used outside convertutf, make it static.
Spotted by Clang.
2018-12-09 23:02:13 -05:00
Augustin Cavalier
cb0977326d kernel: Enforce W^X protection for kernel areas.
We already adhere to this in the kernel itself as well as all
in-tree drivers, so we might as well actually enforce it now.
2018-12-09 15:19:08 -05:00
EXL
f232d9d22c AboutSystem: Minor fix for opening links
It looks like it unfolds to:
> /bin/open /bin/open https://www.example.com

Instead of the expected:
> /bin/open https://www.example.com

See "src/kits/app/Roster.cpp", BRoster::ArgVector::Init() method:
    // init vector
    if (error == B_OK) {
        fArgs[0] = fAppPath.Path(); // Here
        if (argc > 0 && args != NULL) {
            for (int i = 0; i < argc; i++)
                fArgs[i + 1] = args[i];
            if (hasDocArg)
                fArgs[fArgc - 1] = fDocPath.Path();
        }
        // NULL terminate (e.g. required by load_image())
        fArgs[fArgc] = NULL;
    }

Change-Id: Ie7e7155377637b93cbc3c1d225cb91b5e0d2dd7d
Reviewed-on: https://review.haiku-os.org/754
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-09 19:33:55 +00:00
Humdinger
dbbac33163 Mail: save vertical space in the header when reading mail
The layout is unchanged for writing an email.

Changes when reading an email:

* decrease vertical spacing between rows
* move "To" to the right of "From" in the first row
* move "CC" to the right of "Date" in the second row
* move "Subject" down to the last, 3rd row

"CC" still only shows when it contains data.

This is a comparison of the old (left) and new (right) layout:
https://linx.li/new-mail.png

TODO:
It would be nice if the "To" and "CC" were right-aligned.

Change-Id: I89c758bc16af03838e6e3206b2983f451f6044b2
Reviewed-on: https://review.haiku-os.org/753
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-09 19:33:22 +00:00
Alexander von Gluck IV
6e48605b8f kernel: Add riscv config_manager and kernel lib arch sources
Change-Id: Idb40e98f4f664e6bfe0af6bc098bae5c871fb4e5
2018-12-08 16:46:17 -06:00
Barrett17
b6c5bdbd39 MediaFile: Properly use BMediaExtractor::GetMetaData 2018-12-07 18:53:48 +01:00
Alexander von Gluck IV
eb4dd41b42 system/glue: Get your arm outta my risc!
Change-Id: Ie000430275df9be5568d7d8e330743120691ac4f
2018-12-05 10:30:42 -06:00
Alexander von Gluck IV
7dcd941df2 riscv32/64: Stub out some core architecture code
Change-Id: I437dff816e87ec5692cca0aaacaada27b43089ee
2018-12-05 10:14:18 -06:00
Murai Takashi
e28abad762 userlandfs: Fix -Werror=parentheses
Remove unnecessary parentheses in declaration of pointers.
Pointed out by gcc8.

Change-Id: I6f56b12349b6c8433f7ce237f5ce5d7af45bf103
Reviewed-on: https://review.haiku-os.org/750
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Skipp_OSX <jscipione@gmail.com>
2018-12-04 20:46:43 +00:00
Adrien Destugues
5490645d16 ffmpeg: Undo changes to frame time computation
I was misled by ffmpeg docs, the timestamp is indeed in microseconds
already at this point.
2018-12-04 19:16:29 +01:00
Murai Takashi
53ffd9513d libntfs: Fix -Wsizeof-array-decay
Fix sizeof() parameter since sizeof(buffer - 1) returns size of pointer,
not size of array. Pointed out by clang.

Change-Id: Ib0be8a9de65c24a787e5817ea70a1cfc1c14b18f
Reviewed-on: https://review.haiku-os.org/743
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-04 12:54:27 +00:00
Murai Takashi
f8278c1398 codycam: Fix PVS 1321
Fix local variable 'fSettingsDir' is same name as Settings class member
'fSettingsDir'.
https://git.haiku-os.org/haiku/tree/src/apps/codycam/SettingsHandler.h#n148

Change-Id: Ifa12b3239e88bf1f7f29c77704ea1f9f161384f7
Reviewed-on: https://review.haiku-os.org/752
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2018-12-04 12:30:53 +00:00
Augustin Cavalier
652a4674d4 emulex_oce: Add firmware macros to glue code.
The driver optionally can load new firmware onto the device, but
we don't currently ship it. But because it tries to use it means
the symbols get linked in, and so on debug builds it failed to link
since these macros weren't there.
2018-12-02 17:19:32 -05:00
Augustin Cavalier
e24ef16936 EFI: Architecture-specific code depends on GNUEFI headers.
Hopefully fixes the buildbot's recent breakage.
2018-12-02 17:06:54 -05:00
Adrien Destugues
151343ebc8 BLooper: API to hijack existing thread.
I need this to use loopers in WebKit, which spawns threads and expects
to be able to turn them into event loops later on.

This is the pattern already used in BApplication, we may as well make it
available elsewhere.

Change-Id: I5939ca89d33cb3bcc92567b302c2038d976af598
Reviewed-on: https://review.haiku-os.org/735
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-02 21:36:31 +00:00
Jérôme Duval
4bba0571c6 demangler/gcc3+: when the parameter isn't found, return a useful error.
after the last argument, get_next_argument() would call get_next_argument_gcc3(),
see a failure, then call get_next_argument_gcc2(). Ideally we could make
different cookies for gcc2 and gcc3+ demanglers, thus avoiding this issue.

Change-Id: I3904e008a0b6ba627940fb9bca1d44ddbafbcbd0
Reviewed-on: https://review.haiku-os.org/742
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-02 21:35:09 +00:00
Murai Takashi
c9e6afb2af accelerants/radeon: Fix PVS 2007
Fix the '?:' operator returns same value.

Change-Id: I439d30f78213e0dc80c6fed90e5068618faea1fa
Reviewed-on: https://review.haiku-os.org/738
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-02 21:32:09 +00:00
Murai Takashi
b63646d69c bin/trash: Fix PVS 787
Fix 'err' is assigned values twice successively.

Change-Id: I783094dacbd99880381d0359c66359177611506e
Reviewed-on: https://review.haiku-os.org/746
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-02 21:31:26 +00:00
Murai Takashi
4c5e5d8b04 tools/locale: Fix using auto_ptr to array.
Use BStackOrHeapArray instead of using auto_ptr to array.

Change-Id: I171cb002829c36ec51ba7d1e387869263e2a40f2
Reviewed-on: https://review.haiku-os.org/745
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-02 21:31:26 +00:00
Murai Takashi
6439130107 add-ons/locale: Remove unused auto_ptr
Change-Id: Ibe10945ce38dec3f4be229450ba32125539dfdd1
Reviewed-on: https://review.haiku-os.org/744
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-02 21:31:26 +00:00
Jérôme Duval
9f4b382338 wctype: have towlower and towupper check char ranges with no locale backend.
Change-Id: Ie63977bcf54ce9b0a2fa542ba5327c8e8b050e2e
Reviewed-on: https://review.haiku-os.org/740
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-02 21:28:43 +00:00
Barrett17
bc6fcc8aae ape_reader: Remove pedantic instantiate_plugin declaration 2018-12-01 12:43:30 +01:00
Barrett17
b6802a9530 MetaData: Remove support for uint32 keys
* We try to conform to what ffmpeg does, it is
unuseful to support metadata keys formats which
aren't really used anywhere.
* Add TODO with some infos for future improvements.
2018-12-01 12:30:54 +01:00
Barrett17
a57cf128a6 Codec Kit: Introduce declarative macro with version and name
* Namespaces protect symbols, I didn't consider that when adding
the BCodecKit namespace, so, the AddOnManager complained that
instantiate_plugin() was missing. A macro is introduced that allow
plugins to specify it's className, version and name, this ease
the declaration of the plugin symbols, otherwise the function
should have been declared inside the BCodecKit namespace which
we would like to avoid.
* The code is also more future proof, since in future the AddOn manager
can begin to check for plugin versions.
2018-12-01 11:19:12 +01:00
Jérôme Duval
cf6760f20c userlandfs: Read()/Write() with user_memcpy().
Change-Id: I8be72d5fb18228c0ee0394a3f906f7a50113d7ea
Reviewed-on: https://review.haiku-os.org/741
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2018-11-30 22:02:42 +00:00
Murai Takashi
f0a1a07c73 RegionSupport: Fix PVS 338-346
Fix 'true / false' value is implicitly cast to the integer type.

Change-Id: I2f72fcd34d2d97d20e2a98ed5efe25919a485c9d
Reviewed-on: https://review.haiku-os.org/739
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2018-11-30 21:13:14 +00:00
Adrien Destugues
3340ebea4c emulex_oce: fix gcc2 build. 2018-11-29 20:58:30 +01:00
Murai Takashi
6d2736585e libprint: Fix using auto_ptr to array.
Change-Id: If22530aba951e2856fc03cf59de167353db42604
Reviewed-on: https://review.haiku-os.org/727
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2018-11-29 09:57:06 +00:00
kerwizzy
2c5c300420 Mandelbrot: Fix bug that allowed the view to become mirrored.
Change-Id: I88caf3c712bad30fa077bc8c0290b4706541c2b0
Reviewed-on: https://review.haiku-os.org/731
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-11-29 09:50:19 +00:00
kerwizzy
e920ab3cb6 Mandelbrot: Improve thread handling code.
* Application is now much more stable and less likely to crash
 * Almost all communication to render threads is done through semaphores.

Change-Id: I7858cdb4a2b83ef4bfe44588cebef01bd3304346
Reviewed-on: https://review.haiku-os.org/730
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-11-29 09:50:19 +00:00
Jérôme Duval
887990594d userlandfs: cloned area is only for kernel access.
Change-Id: I13b7bf1e14e37da6d65e56b99501006aa05170b1
Reviewed-on: https://review.haiku-os.org/737
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2018-11-28 20:16:51 +00:00
Alexander von Gluck IV
4cd471eb17 emulex_oce: Don't clobber ticks define 2018-11-28 15:52:42 +00:00
Barrett17
b9ca2a8d0b ape_reader: Use BCodecKit namespace 2018-11-28 09:33:24 +01:00
Humdinger
1eca0c487b HaikuDepot: Add accidentally removed space
Re-add the space between currently downloaded package and number
of packages to be downloaded in status view.

I accidentally removed that in hrev52432.
2018-11-27 19:00:56 +01:00
Barrett17
278d03da22 media_kit: Remove most private dependencies from codec_kit
* Move to BCodecKit namespace and make extensive use
of BCodecRoster.
* This is a first step in the right direction of
decreasing private dependencies. Some APIs are being
translated to the CodecKit. I am doing an investigation
on which APIs are really used among apps, so that the new
kit can be more slim and oriented toward easy development
and can be extended in the right direction instead to
continue maintaning unuseful code.
* BMediaFormats needs still a bit of love.
* General improvements in style and code maintainability.
2018-11-27 11:38:05 +01:00
Barrett17
5232a91136 media_plugins: Rework to use the BCodecKit namespace 2018-11-27 11:38:05 +01:00
Barrett17
fe9542fdb5 BCodecRoster: Add useful functionality from MediaFormats 2018-11-27 11:38:05 +01:00
Barrett17
d33bd9ec7b Codec Kit: Introduce BCodecKit namespace 2018-11-27 11:38:04 +01:00
Barrett17
f20ff4faec CodecRoster: Add GetDecoderInfo 2018-11-26 07:41:27 +01:00
Barrett17
9a49da9d4e Fix raw_decoder build 2018-11-25 18:57:15 +01:00
Augustin Cavalier
aa6411e23e libnetwork: Move from src/kits to src/system.
Properly speaking, this is part of POSIX and not of the Be-style
"kits", and so it should live in system/ alongside libroot.
No functional change intended.

Change-Id: I0fcf78a09c76e220ad4f1719d147978ef4a3bc52
Reviewed-on: https://review.haiku-os.org/726
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-11-25 17:49:00 +00:00
Augustin Cavalier
c43e1e927f freebsd11_network: Some additions fos for atheroswifi10k. 2018-11-25 12:44:43 -05:00
Barrett17
ec45f6adce Codec Kit: Move plugins to new class names 2018-11-25 17:31:11 +01:00
Barrett17
1b96c34179 ChunkProvider/ChunkWriter: Move method to protected
* Remove inline destructor.
2018-11-25 14:07:46 +01:00
Barrett17
915d566198 ape_reader: Update class names 2018-11-25 13:02:03 +01:00
Barrett17
cd56456672 ffmpeg: Update class names 2018-11-25 13:02:03 +01:00
Barrett17
ee09c29148 Media Kit: Update private code 2018-11-25 13:02:02 +01:00
Barrett17
be805d02d7 Codec Kit: Rename classes to BFoo pattern 2018-11-25 13:02:02 +01:00
Barrett17
082e4ae4a7 Codec Kit: Rename files 2018-11-25 13:02:02 +01:00
Augustin Cavalier
ef593f61a2 ELF: Ignore PT_EH_FRAME and PT_STACK.
This allows Clang builds (linked with our cross binutils) to
at least start runtime_loader and then try to load launch_daemon.
That fails with an infinite loop somewhere...
2018-11-24 21:08:31 -05:00
Augustin Cavalier
aa0836519a kernel: thread->name is never NULL as it is an array.
Spotted by Clang (-Wtautological-pointer-compare.)
2018-11-24 21:07:18 -05:00
Augustin Cavalier
df4074fbed Remove a lot of unused constants.
Spotted by Clang. No functional change intended.
2018-11-24 19:21:16 -05:00
Augustin Cavalier
80d966a005 ArchitectureRules: Use the same warning flags for kernel as for userland.
This requires disabling some EnableWerror, as there are a lot of
sign-comparison warnings triggered in certain drivers that now
need to be fixed.
2018-11-24 17:49:20 -05:00
Augustin Cavalier
d520204085 Fix various instances of -Wsign-compare. 2018-11-24 17:48:02 -05:00
Murai Takashi
137ac19964 String.cpp: Fix PVS 625
Fix 'newBuffer' is assigned values twice successively.

Change-Id: Id6ec9d40ba279a68e17922931098a6a908eb7156
Reviewed-on: https://review.haiku-os.org/728
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2018-11-24 12:04:41 +00:00
Murai Takashi
a9002af95e UndoBuffer.cpp: Fix PVS 471
Fix 'fTypedText' is assigned values twice successively.

Change-Id: Ibadf2fced0f448441e541293d04b86bc14909c35
Reviewed-on: https://review.haiku-os.org/729
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2018-11-24 12:04:32 +00:00
Augustin Cavalier
003a1997d5 ps2/elantech: Initialize variables to shut up GCC. 2018-11-23 19:13:37 -05:00
Augustin Cavalier
62c7ec5c06 Fix various instances of -Wset-but-unused.
Largely no functional change; most of these are just
removing the unused variables.
2018-11-23 18:04:38 -05:00
Augustin Cavalier
8732e626e2 pkgman: Handle -y argument to "drop-repo" command.
Found by -Werror=set-but-unused.
2018-11-23 18:00:08 -05:00
Augustin Cavalier
430f303fda file_systems/cdda: Set CDDB lookups based on the actual parameter.
Found by -Werror=set-but-unused.
2018-11-23 17:59:35 -05:00
Barrett17
e0a6d5ceeb MediaClient: Fix -Werror=set-but-unused
* The error wasn't checked.
2018-11-23 23:46:31 +01:00
Augustin Cavalier
d113c00b5a Remove more HOST_PLATFORM_SUNOS cruft. 2018-11-23 16:29:57 -05:00
Augustin Cavalier
807304b100 build: Add basic support for MinGW hosts.
This doesn't fully work yet (the FS code in libroot_build
needs to be adapted, as some of the symlink-related calls
are not available on MinGW), but it gets much further than
the "Cygwin" target did.
2018-11-23 16:24:25 -05:00
Augustin Cavalier
37c106060a build: Remove support for cross-building from Cygwin and SunOS.
These have been broken for a long time. Some Cygwin changes that
are relevant on MinGW are kept here, but users on Windows who
want to build Haiku should probably use WSL at this point.

However, now that we are using relative paths and don't need
to worry about drive path kludges, it's actually possible to
get some host tools built on MinGW. Changes for that coming.
2018-11-23 15:40:50 -05:00
Murai Takashi
26b2733af3 Locale kit: Fix PVS 550, 551
Use BStackOrHeapArray instead of applying auto_ptr to array.

Change-Id: I204dcb97a1bc2d047783bc6015f86b36ca0cc15b
Reviewed-on: https://review.haiku-os.org/725
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-11-23 18:57:02 +00:00
Barrett17
44fc903a8f Codec Kit: Introduce BCodecRoster
* This class include almost everything you need to
manage codecs and iterate over them.
2018-11-22 17:41:26 +01:00
Peter Kosyh
fa94c7d6a5 mail: IMAP fix recv forever loop on server close connection
When reading stream from closed (by server) TCP socket throw StreamException (not ParseException).
This fixes forever loop in Protocol::HandleResponse on server disconnect.

This patch fixes #14710

Change-Id: I29e9830b360cb56cb1ef037c0378d64422075c4d
Reviewed-on: https://review.haiku-os.org/724
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-11-22 15:23:14 +00:00
Murai Takashi
81728c84c5 modifiers: Fix PVS 743
Fix  'gotone' is assigned values twice successively.

Change-Id: Ibe9f531ba4d16cec61b49cc49e842486b5ab6f64
Reviewed-on: https://review.haiku-os.org/700
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-11-22 15:22:19 +00:00
Barrett17
af34e7abcc Codec Kit: Beauty fixes 2018-11-22 09:47:11 +01:00
Augustin Cavalier
c6c8dd4e2c syslog_daemon: We don't need strlcpy.c anymore. 2018-11-21 23:52:49 -05:00
Augustin Cavalier
a87c7773e8 EFI: Make the loader build under Clang.
Clang doesn't support -maccumulate-outgoing-args, -nostartfiles
is not needed in LDFLAGS (and lld doesn't know about it anyway),
and Clang uses .dynstr so we need to copy it also.
2018-11-21 22:02:06 -05:00
Augustin Cavalier
2e15a0f6b9 registrar: Move R5Compatibility to test directory.
Only the test_registrar uses it now (but maybe this is a leftover
that can be removed from it, too?)
2018-11-21 21:27:12 -05:00
Barrett17
32bcb26dfc Remove inadvently added merge-conflict file
* Sorry about that, I've been splitting the
commits and it did end up here.
2018-11-21 17:35:04 +01:00
Barrett17
b1c8bb2c46 MediaFile/MediaTrack: Use MetaData API internally 2018-11-21 17:24:33 +01:00
Barrett17
854c698a52 ffmpeg: Move AVCodecWriter to BMetaData 2018-11-21 17:23:58 +01:00
Barrett17
608c9d9ae1 Codek Kit: Introduce BMetaData in Writer/MediaWriter
* Remove SetCopyright as well.
2018-11-21 17:22:58 +01:00
Barrett17
9b50ad1db8 MediaFile/MediaTrack: Use metadata to retrieve copyright 2018-11-21 16:57:05 +01:00
Barrett17
c6a23a5827 ffmpeg: Use new BMetaData API 2018-11-21 16:56:41 +01:00
Barrett17
3e8f721b3b Codec Kit: Introduce BMetaData in Reader/Extractor
* Remove superfluous Copyright method.
2018-11-21 16:55:02 +01:00
Barrett17
9bbd53a288 BMetaData: Add missing functionality
* Add more metadata keys needed to support ffmpeg.
* Implement methods allowing to embed BMetaData into
BMetaData.
* Add methods to handle more types.
2018-11-21 16:51:19 +01:00
Barrett17
f722040584 BMetaData: Finalize implementation
* Use string keys. I am still convinced we need BValue.
* Use boolean instead of status_t in return, this is
much more handy in pratical use given that there's no
really a status to check.
2018-11-21 12:46:54 +01:00
Mikael Konradsson
2d0c3dd649 Appearance: Added BSpinners for setting font sizes.
Change-Id: Ic8036e512cda3e30b653092fa718b03e1b042ecc
Reviewed-on: https://review.haiku-os.org/710
Reviewed-by: Kacper Kasper <kacperkasper@gmail.com>
2018-11-20 20:36:24 +00:00
François Revol
84f9d70b0f shelf saver: hopefully fix x86_64 build 2018-11-20 16:54:43 +01:00
François Revol
8c4a96818d shelf: use layout for the config view & B_TRANSLATE 2018-11-20 05:05:11 +01:00
Augustin Cavalier
8f21fce0ff HDA: VirtualBox no longer needs QUIRK_NO_CORBRP_RESET_ACK. 2018-11-19 18:29:16 -05:00
Augustin Cavalier
efd9848f27 HDA: VMware's emulated controllers have HDA_QUIRK_NO_CORBRP_RESET_ACK.
On my VMware Player installation, the device ID is "1977", but presumably
VMware will have only one HDA codebase, and so we just enable the fix on
all devices.

This fixes initialization of the HDA driver on VMware, and means that
it is now possible to get sound output on VMware without using the
OpenSound driver package.
2018-11-19 18:29:06 -05:00
Niels Sascha Reedijk
39c461f50c Printers preflet: Properly handle plurals for the pending jobs
Change-Id: Iac7cad00df0d52060fbc19fcc5551e21da66f152
Reviewed-on: https://review.haiku-os.org/713
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-11-19 13:09:29 +00:00
Augustin Cavalier
7d5acf5763 userlandfs: Fix build breakage on GCC2. 2018-11-18 23:22:53 -05:00
Augustin Cavalier
400ed5ca50 h2generic: Copy the user buffer before using it. 2018-11-18 14:50:53 -05:00
Augustin Cavalier
2897df9676 bluetooth: ioctls always pass size on Haiku. 2018-11-18 14:42:09 -05:00
Augustin Cavalier
59ecfa6cb6 netfs: Fix and enable on 64-bit. 2018-11-18 14:37:06 -05:00
Augustin Cavalier
f0d5e5b062 userlandfs: Fix the BeOS frontend on 64-bit. 2018-11-18 14:36:28 -05:00
Augustin Cavalier
966c60f355 BMetaData: Fix GCC7 build. 2018-11-18 13:04:10 -05:00
Zoltán Mizsei
9f2e5521fa Signature have to match in rdef and sources.
Change-Id: I4172585fab51e9d9640ae7a40b5b9c3a247fb841
Reviewed-on: https://review.haiku-os.org/711
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-11-18 17:45:24 +00:00
Niels Sascha Reedijk
e980073d22 Clarify desklink translatable
Change-Id: Ia36e44ae4c6fec37694712dd1388cd1abb867f31
Reviewed-on: https://review.haiku-os.org/712
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-11-18 17:44:13 +00:00
Peter Kosyh
a6a7e73f80 mail: revert ~IMAPProtocol
Waiting of worker threads in IMAPProtocol destructor introducred new deadlocks.

For example: fWorkerLock grabbed in destructor leads to deadlock with 
CheckSubscribedFoldersCommand (which grabs this lock with flock grabbed).

So, currently it should be reverted.

Change-Id: Ibc4b4f85300352e045d4ce72deb804e0e613f25c
Reviewed-on: https://review.haiku-os.org/714
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-11-18 17:43:45 +00:00
Barrett17
1f2ddf2fd0 Codec Kit: Initial BMetaData implementation 2018-11-18 16:57:12 +01:00
Barrett17
b4d8bbd540 Codec Kit: Move Managers to private headers
* Those classes are not ready for public consumption. Ideally,
I'd add a well designed BCodecRoster wrapping them. This is part
of the general cleanup I am doing to get the code in a good state
before going to finalize the design.
* I don't plan to reintroduce BMediaFile in the media2 API, and
I'd like to remove any (explicit) usage of entry_refs and things
like that.
* I plan to introduce BMetaData and BMediaFormat which is going
to be different than what we do now.
* We need to explicitly use the mime type when it's available and
it is another design consideration when CodecRoster will be introduced.
2018-11-18 13:15:35 +01:00
Barrett17
3fe994ba28 MediaExtractor: Move stream_info to private 2018-11-18 12:53:14 +01:00
Barrett17
121db87f5f Revert "codec_kit: Remove Perform"
This reverts commit a9ccd74af7.
2018-11-18 12:06:14 +01:00
Augustin Cavalier
041a1f3639 userlandfs: Only add kernel flags in RequestAllocator in _KERNEL_MODE.
Otherwise, create_area fails with "Invalid Argument." Should fix the
"empty directory in userlandfs mount" bug that has been appearing
since the cloneable-area fixes.

Change-Id: I26e73539a9f345e76b22a34a68fe4b49c63683c2
Reviewed-on: https://review.haiku-os.org/707
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-11-18 05:09:13 +00:00
Jérôme Duval
8c053e955e vfs: fail write_stat() on file descriptors opened read-only.
Change-Id: I20d586c606c47df6625cc9272f153250a5a621d6
Reviewed-on: https://review.haiku-os.org/706
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-11-18 00:04:26 +00:00
Augustin Cavalier
9cc0f06a01 kernel: Remove the B_KERNEL_AREA protection flag.
It is now no longer used.
2018-11-17 16:46:49 -05:00
Augustin Cavalier
04f1a9beae vm: B_EXECUTE_AREA should not imply B_KERNEL_EXECUTE_AREA.
Trying to execute user-mapped areas in kernel space should trigger
a fault with SMEP enabled anyway (and we have not seen any thus far.)
2018-11-17 15:24:59 -05:00
Augustin Cavalier
d12a2ff55c vm: Block userland from modifying any area owned by the kernel.
Previously this protection was possible via the opt-in B_KERNEL_AREA flag,
however, almost nothing used that, so in practice these protections were
rarely enforced.

Userland can still access kernel areas according to the protection flags
(and due to SMAP, these have been refined and reduced as appopriate)
and clone them (according to B_USER_CLONEABLE_AREA flag, which has
been required since August of this year), but they can no longer
resize them (something no in-tree application does on any shared area),
set protections (otherwise they could add B_USER_CLONEABLE_AREA...),
unmap them, or essentially do anything else besides get their
information (and even that we should restrict to uid 0, in the future.)

From my testing, this does not introduce any issues, and no applications
nor drivers should have been relying on the previous behavior (unlike
SMAP or the clone-area changes, which did affect applications.)
2018-11-17 15:11:12 -05:00
Augustin Cavalier
a54cdaa07a idualwifi7260: Fix a different instance of memset(NULL). 2018-11-17 14:57:50 -05:00
Augustin Cavalier
01304f19fd idualwifi7260: Don't memset NULL. 2018-11-17 14:05:14 -05:00
Barrett17
a9ccd74af7 codec_kit: Remove Perform
* Undocumented and apparently unuseful pattern.
2018-11-17 18:42:50 +01:00
Barrett17
9d90a8381d StreamerPlugin: Add ctor 2018-11-17 18:39:39 +01:00
Kacper Kasper
35dbbd990c ProcessController: fix replicant for 12 CPUs
* Slightly change the formula for bigger sizes (use real width).

Change-Id: I66204c2727f30e3f139b506174e287811c258fa9
Reviewed-on: https://review.haiku-os.org/704
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2018-11-17 16:30:45 +00:00
Peter Kosyh
a6a1266240 mail: IMAP fix deadlock when connection failed
fLocker must be released in IMAPConnectionWorker::_Worker() before WorkerQuit() call.

Change-Id: I1e622a711fa3349986560af1118b158696025844
Reviewed-on: https://review.haiku-os.org/705
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2018-11-17 16:26:35 +00:00
Adrien Destugues
a4ba432352 Fix line counting in StringView.cpp
- if fText is an empty string, we would start searching past its end,
  possibly leading to a crash (noticed this in HaikuDepot).
- if fText is NULL, BString would report a size of 0 lines, it makes
  more sense to report a size of 1 line.
2018-11-17 14:12:25 +01:00
Michael Lotz
d69baff8cc virtio_net: Align transfer buffers, check get_memory_map result.
The buffers were allocated with B_ANY_KERNEL_ADDRESS and the buffer plus
header block would produce uneven sizes. This lead to some buffers
crossing page boundaries. The call to get_memory_map() is only supplied
with a single entry, which in such a situation may not be enough if the
physical pages are not contiguous. Due to missing result checks this was
not noticed.

Use B_ANY_KERNEL_BLOCK_ADDRESS and align the size of the total buffer
to avoid such page boundary crossing.

Fixes randomly truncated frames in the receive path.
2018-11-17 00:34:49 +01:00
Michael Lotz
15a0bc24cc virtio_net: Use proper frame length in receive path.
Previously the frame length was set to the allocation size of the buffer
itself, which is constant. Use the length returned on dequeing instead,
which tells how much of the buffer was actually filled.

Fixes overly long frames that lead to various problems along the receive
path.
2018-11-17 00:34:49 +01:00
Michael Lotz
2f211cce6d virtio: Replace size return with usedLength in queue_dequeue.
The size was in fact the count of physical entries that were used. That
number must necessarily be the same as the number given when adding to
the queue, so that number isn't really interesting. Consequently none
of the users of that API made use of it.

Return the used length instead, which is the way virtio signals how much
valid data resides in the dequeued buffer. This is for example important
to know the frame length of incoming packets in virtio_net.
2018-11-17 00:34:49 +01:00
Michael Lotz
14b0498cfa arp: Trim the reply buffer to the filled length.
We reuse the incoming request buffer to send our reply. We did however
not trim that buffer to the length we actually filled out, allowing
any extraneous incoming data to remain in that buffer and be sent back.
2018-11-17 00:34:49 +01:00
Humdinger
1eb0122fc7 pkgman: a bit more detail on usage
I forgot that there are special usage texts for the individual
pkgman commands. Make that a bit clearer in the usage text now.

Change-Id: Ia6641b2aa20d03a67d9dedddabf3a1f34d324322
Reviewed-on: https://review.haiku-os.org/702
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-11-16 16:11:50 +00:00
Augustin Cavalier
a5297c5905 build: Add SYS:NAME attribute to all folders handled by Tracker.
Mail and Deskbar folders are still TODO.
2018-11-15 22:36:35 -05:00
Augustin Cavalier
795f1571b3 Move data/image_directories to src/data/directory_attrs.
These data files are used in the generation of build targets,
so moving them to src/data alongside the package_infos & etc.
makes more sense.

They don't seem to be activated properly though (I added some tracing
to try and figure out why they aren't used but haven't gotten to the
bottom of that yet.)
2018-11-15 21:20:24 -05:00
Augustin Cavalier
a4dcbfcef1 Mail: Detect URLs by parsing ahead instead of checking every character.
This is a *massive* performance improvement; some longer emails that
took 45+ seconds to load before now take < 1 second, at the cost
of a completely rewritten URL detector. This means some URLs that
were detected before (e.g. anything starting with "www", emails
without "mailto:", etc.) are now not detected, though support
for detecting them could be reinstated in the future.

Fixes #4816.
2018-11-15 20:21:35 -05:00
Murai Takashi
f54b080275 fwcontrol: Fix PVS 1655
Fix char pointer *nodestr was compared with the '\0' value.

Change-Id: Ie6b0beb8b94b35d6824ab205688ce1a54bcd6a74
Reviewed-on: https://review.haiku-os.org/688
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-11-15 19:14:19 +00:00
Murai Takashi
63757dbb24 TGATranslator: Fix PVS 2332-2337, 2341-2346
* Use new(std::nothrow) so that NULL check for allocated memory makes sense.
* Other new() without NULL check is replaced with new(std::nothrow).

Change-Id: Ida53be936d14ce63b3bc60442408ec5044df5344
Reviewed-on: https://review.haiku-os.org/699
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2018-11-15 08:22:48 +00:00
Peter Kosyh
e0dbea8a60 mail: use MAIL:status instead of deprecated MAIL:read to query new e-mails
Change-Id: I758cb2b4c3111a300500976d7711e93f9d838a0b
Reviewed-on: https://review.haiku-os.org/687
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-11-14 00:34:47 +00:00
Peter Kosyh
239566d908 mail: simpler query for new e-mails
Before this patch, the BEOS:type was used in query. But in Haiku
the BEOS:type index is not created by default. So, this feature
dis not work.

Change-Id: Ib57b528eb852d256b7e0b7d203659af01e077801
Reviewed-on: https://review.haiku-os.org/684
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-11-13 19:31:53 -05:00
Peter Kosyh
1f41c99ffa mail: IMAP inbound protocol destructor fix
This should fix crashes of mailer_daemon in IMAP workers.
This patch makes IMAPConnection destructor wait for all working threads to finish.
Also, do not call _Connect for QuitCommand (it speedups shutdown procedure).

Change-Id: Idffcc00d3459a96a85a8a073a343bcf4cd4984be
Reviewed-on: https://review.haiku-os.org/686
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-11-13 19:31:23 -05:00
Murai Takashi
71103e733c StyledEdit: Fix PVS 1167
Use new(std::nothrow) so that NULL check for allocated memory makes sense.

Change-Id: I6c0e66c63adda430686727a4085132c4e40c7530
Reviewed-on: https://review.haiku-os.org/692
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-11-13 19:58:08 +00:00
Murai Takashi
82bbd737a1 sis7018: Fix PVS 1617
Use new(std::nothrow) so that NULL check for allocated memory makes sense.

Change-Id: Iab5efa869b83f5a312a1eaf8851a9e99888ff075
Reviewed-on: https://review.haiku-os.org/691
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-11-13 19:58:08 +00:00
Murai Takashi
6c8b0b3724 PNGTranslator: Fix PVS 2237-2241
* Use new(std::nothrow) so that NULL check for allocated memory makes sense.
* Other new() without NULL check is replaced with new(std::nothrow).

Change-Id: I23df98e58ea1960463e86a75ff69d67855f59074
Reviewed-on: https://review.haiku-os.org/690
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-11-13 19:58:08 +00:00
Murai Takashi
99b0a7e0ed OpenSound: Fix PVS 2232, 2233
Use new(std::nothrow) so that NULL check for allocated memory
makes sense.

Change-Id: I690a796ac5a9a7a61440ccccf19f93fc6bf2d328
Reviewed-on: https://review.haiku-os.org/689
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-11-13 19:58:08 +00:00
Augustin Cavalier
05f730b0f8 More WriteAttr -> WriteAttrString cleanup across the tree.
Some of these were correct as they were ... but most weren't.
There are a variety of other correct ones I didn't change over yet
that someone else probably should (GCI task?).
2018-11-11 16:22:10 -05:00
Augustin Cavalier
5f5cc39c2c STXTTranslator: Fix truncated "be:encoding" attribute write.
Same issue as the mail_util fix.

Also while I'm here, alter behavior so that the Be-style attribute
gets overwritten with the Haiku-style one, instead of getting left
as is.

Should potentially help with #14674.
2018-11-11 15:58:45 -05:00
Peter Kosyh
398bb93961 mail: fixes of default notifier (reset)
This fixes POP3 notification messages.

Change-Id: Ic7d9c0bb23c4dc9814f6c4bade0aba367fa28db1
Reviewed-on: https://review.haiku-os.org/685
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-11-11 20:36:28 +00:00
Peter Kosyh
fea29e79c7 write_read_attr: fix truncated B_MAIL_ATTR_STATUS
This fix garbage attributes on e-mail messages on status changes.

Change-Id: I5293a0e71a1b84c04889fa3375488b0075aad12e
Reviewed-on: https://review.haiku-os.org/682
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-11-11 14:26:55 +00:00
Augustin Cavalier
23623eee9a registrar: Remove now-unused non-Haiku code. 2018-11-10 15:16:25 -05:00
Augustin Cavalier
387609c3be shortcuts: Remove #if __INTEL__.
This isn't true on x86_64 (so we were displaying the wrong key names there).
The actual names of the keys should probably be fetched from the selected
keyboard.
2018-11-10 15:02:04 -05:00
Augustin Cavalier
3bf15c7f86 shortcut_catcher: Remove non-Haiku code. 2018-11-10 15:01:45 -05:00
Augustin Cavalier
231ee3b8ad mail: Remove regex match limitation from the BeOS days.
It was still enabled on 32-bit x86...
2018-11-10 15:00:49 -05:00
Augustin Cavalier
68d50ca8a3 mail_daemon: Replace own_image with the one from PowerStatus.
We probably should make this a common function...

Fixes the mail status icon not appearing on x86_64, as __INTEL__ is
not defined there.
2018-11-10 14:28:26 -05:00
Augustin Cavalier
494a6e4e8e kernel/vm: Remove hacky stack dumper from vm_page_fault.
As the TODO said, we now have good userland debugging facilities, so
this isn't needed (and has been if 0'd out for almost a decade now.)
The dprintf on page faults may still be useful under rare circumstances,
but we already have a "TRACE_FAULTS" configuration for this file,
so guard it behind that.

Fixes part of #14360.
2018-11-10 14:12:18 -05:00
Adrien Destugues
c4bb4fbb7e Devices: remove "not implemented" driver line
This just confuses users. Let's re-add it when we have implemented it.
2018-11-09 20:30:39 +01:00
Adrien Destugues
0ca6ba69fa screenmode: remove leftover debug print. 2018-11-09 20:29:35 +01:00
Adrien Destugues
4c8208af52 ffmpeg: fix crash at end of video stream
Mixing new and old style decoding APIs won't work. And we were still
using the old API for managing the end of videos.

Change-Id: Ic194ab98721455658ecefde4f951c3f1e43ae1be
Reviewed-on: https://review.haiku-os.org/679
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-11-08 20:09:08 +00:00
Peter Kosyh
2e8be594e7 mail_daemon: IMAPConnectionWorker missing ::WorkerQuit() on errors
This fixes some crashes.

In _Worker thread on connect or process errors fOwner.WorkerQuit(this) was not called, leaving destroyed thread object in fWorkerMap and fWorkers.

Moreover, on connection problem the imap mailboxes was never checked on next planned sync because of non empty fWorkers.

Change-Id: I55ce6474b655fad5ddd8024225fc8f633bc35c48
Reviewed-on: https://review.haiku-os.org/678
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-11-08 14:26:03 +00:00