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>
* 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.
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>
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.)
* 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>
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>
- 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.
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.
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.
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.
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.
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>
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.)
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.
* 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>
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>
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>
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>
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>
* 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>
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>
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?).
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.
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>
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.
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.
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>
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>
This fixes STORE FLAGS request and gmail
Change-Id: I28c507244788e2e56e46bef428a465bd8d798d51
Reviewed-on: https://review.haiku-os.org/673
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* It's now a vector icon as well.
* Vertical mode doesn't look that good anymore with higher font sizes,
but I didn't understand how to do it properly.
Change-Id: I0eed0e2873b270c349dfd3af117cfcb751e590a1
Reviewed-on: https://review.haiku-os.org/671
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
- Enlarge the window's width so a larger part of the path will fit in the TextBox.
- Apply the existing path to the BFilePanel before browsing. It improve
usability when you paste a path or type a new one in the TextBox
then click on the browse button to choose the application
or fine tune the directory.
Please not that it is a best effort feature : if the file or the directory does
not exist, the BFilePanel will fallback to the old behavior :
showing the previously selected file/directory in the session
(or home directory).
Change-Id: I504a1ec72f9f7a236e2e37039961fddc58218eae
Reviewed-on: https://review.haiku-os.org/672
Reviewed-by: Rene Gollent <rene@gollent.com>
* Adds max width and height arguments to
instantiate_deskbar_(item|entry).
* Old applications just stay with a 16x16 scaled icon, though.
* All used apps within the repository are converted to the new call
besides the input_server input method icon (that will need further
API changes in the input_server).
Change-Id: I29cc439396917be2c24135888459d31364997dff
Reviewed-on: https://review.haiku-os.org/656
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
See RFC 5231 (https://tools.ietf.org/html/rfc5321): "Following the normal
syntax for multiline replies, these keywords follow the code (250) and a
hyphen for all but the last line..."
Change-Id: I1ee533a332d1e18ffddd4ad1520d14f4013b739e
Reviewed-on: https://review.haiku-os.org/670
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* This also removes the mini/large icon mode for list views; it's now
simply always matching your font size.
Change-Id: Ieedd86cc3a50dd0f950d97bbd9839384d44f8bd3
Reviewed-on: https://review.haiku-os.org/662
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This API allows us to send whole packets no matter how the video is
formatted, and get frames out as they are ready (sometimes multiple
frames per packets, which did not work well with the previous API).
Change-Id: I0bd7d4706e330bb11d87cb41e93cfc6995b4b3a5
Reviewed-on: https://review.haiku-os.org/665
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This field is deprecated.
Change-Id: I18c3b89ef7438c61b464aaf8bebc1484bf479d6b
Reviewed-on: https://review.haiku-os.org/664
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Use ffmpeg functions to format the timestamps.
Change-Id: Idd51feb22fc6c5a70e177604eb995ae2d8601cd4
Reviewed-on: https://review.haiku-os.org/663
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Some IMAP servers (such as dovecot) have hard line length limits for
commands.
The way UID FETCH was being scheduled was creating FETCHes longer than
the maximum length.
Limit these to a reasonable number of UIDs per fetch, such that we have
a hope of success when facing monsterous mailboxes.
Change-Id: I8a2184eec1b8fcab6f7914a9b14ad008700b96d1
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
Reviewed-on: https://review.haiku-os.org/c/haiku/+/626
Style fixes by me, and also replaced emplace_back with push_back
for GCC2 compatibility.
These are needed for the "non-legacy" TX path in ipro1000.
Also remove the "spinlock" member from struct mtx; struct mtx_spin
is different (and not implemented by us presently.)
Does handle coords correctly, but two finger jumps position somewhere
We can also report actual buttons, but not sure how movementmaker handles
it.
Will do cleanup once working
To test or help out return B_OK in probe_elantech
* Actually draw the string at the bottom of the frame.
* Unfortunately BStringList cannot be cached because there is no
space left in the class.
* Change SGI and PNG translators to use it in place of BTextView.
Change-Id: I07e12bf1a8dc956d18c9624604c7b63453ad15a2
Reviewed-on: https://review.haiku-os.org/620
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
screenmode can now set the brightness (only for intel_extreme, still).
Both absolute and relative values are accepted, allowing to bind
keyboard shortcuts to "increase brightness" and "decrease brightness".
Change-Id: I5221532ebdfba5df1b4d4e1f3331406359f2807c
Reviewed-on: https://review.haiku-os.org/655
Reviewed-by: Kacper Kasper <kacperkasper@gmail.com>
Curerntly contains support for amiga RDB and Apple (PPC) partitionning systems,
that is, things that might be useful, but not for most users, and was
not part of the default package.
Naming inspired from the Extras disk shipped with Amiga Workbench, for
lack of a better idea.
Change-Id: I57fb229806139939bc019e6c43b0aec7ea1f483a
Reviewed-on: https://review.haiku-os.org/652
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
We won't need the mailbox for most chipsets except bcm2835
to determine the framebuffer base address.
(especially at this early boot stage)
This simplifies things by making the mailbox usage limited
to boot_arch_arm and not spreading it all thoughout the
platform u-boot code... however we keep the mailbox driver
as-is since it would make a good kernel driver someday.
mmu_man mentioned us "finding" the fb base from the mailbox
and modifying the FDT to let it know the base reg of the
framebuffer... that's beyond 'just getting things building'
though :-)
Change-Id: Ic2772b85dff004f9d21447ea5958b5ae9776d526
OpenJDK 1.8 somehow manages to trigger this. Before this commit it would
just attempt to read past the end of the vector, which of course segfaulted,
which seems to imply nobody has run into this case before.
Using BDateFimeFormat avoids going through libroot and up again to ICU
throuhg the locale add-on. Moreover, it uses the Locale settings
directly instead of relying on the LC_* environment variables.
Fixes day names in Web+ history menu always showing in english. Tnaks to
Oco for noticing!
Change-Id: I0c7f321a6147e8f5ab31f82de836c5ad23bb321b
Reviewed-on: https://review.haiku-os.org/650
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
FreeBSD's "ticks" has a granularity of whatever "hz" is, presently 1000.
It's declared as "extern int32" in FreeBSD's codebase, as it's the
defining unit of time for most operations.
We just use system_time() for essentially the same purpose, which requires
no hard-clock timer interrupts at all, and so Colin seems to have decided
to emulate "ticks" by just triggering a timer once per millisecond and then
incrementing the "ticks" variable.
1000 timer interrupts per second is quite a lot (assuming the kernel
actually combined these between drivers, otherwise it would be 1000
*per driver*), and probably a contributor to Haiku's not-so-great
battery performance on most laptops.
The next commit will make it a "#define" instead of an "extern".
I've already submitted this for upstream inclusion in FreeBSD.
Sorry for the noisy diff with all the whitespace changes...
sRandomLock is a driver-global lock used by all instances of the "random"
device, of which there can be more than one, it seems; and somehow some
are destroyed before others. I didn't really investigate too far to see
under what circumstances that occurs.
Found while trying to compile some ports; suddenly all attempted
reads of /dev/random started PANIC'ing with "mutex uninitialized".
It seems GCC2 occasionally will inline a call to memcpy with
a count of 0, which this function did not previously expect
and would result in a "Divide Error Exception."
Hopefully fixes#14613.
* Initialize "status" to B_NO_INIT, which will skip the main 'if'
the first go-around and go straight to the acquire_sem_etc(),
as we will have be invoked from the callout initializer, and so
there will of course be no callouts.
* Actually check the return code of mutex_lock, and do another loop
iteration (which skips this main 'if' as status will not be one
of those things.)
* Correct failure deinitialization order in init_callout().
* Destroy the mutex after the worker thread exits (this is the real fix.)
Fixes#14660, and other "hang on cursor" / "hang on black screen" /
or possibly even a "hang on rocket" introduced in yesterday's builds.
DeleteChains() needs the chain locks and domains, so those need to
be uninitialized after them. This now matches the constructor's
deinitialization order.
Fixes a panic exposed by the previous commit.
Previously, there were a number of circumstances where these were
not getting reset properly, leading to some destroyed mutexes having
holders of the last thread which locked them, and some with "-1",
which meant that the next call to "mutex_lock" just behaved as if
the lock was still valid (!), and so the unlucky caller would deadlock
forever.
Now we properly reset these fields, which means from now on attempts to
lock or unlock destroyed mutexes will lead to "PANIC: uninitialized mutex"
on KDEBUG kernels, and (as before) an infinite deadlock on non-KDEBUG
kernels (perhaps we should store the thread_id of the locker on non-KDEBUG
kernels also?).
As the next commits will show, this already uncovered a number of bugs,
and there are of course potentially more strange deadlocks caused by this.
Added subsystem_vendor_id and subsystem_id for iMac 24 inch early 2008 (iMac 8,1) and Macbook Pro 3,1 with specific quirks for those systems. This enables sound via head phone out at a decent level and quality. Previously, sound with the Haiku HDA driver was distorted and very low
Change-Id: I8e3dc3dbf5324bafff2b35ae64b43a0088272c8d
Reviewed-on: https://review.haiku-os.org/647
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Use delete[] instead of delete, since memory is allocated by new[]
at line 139.
Pointed out by clang.
Change-Id: I70396283b8d2c01d52886f7543804998d891ea44
Reviewed-on: https://review.haiku-os.org/646
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Some packages have excessively long copyright labels that were forcing
the HaikuDepot window to become too wide. So in this case, put the full
copyright string in the tooltip, and only the first 45 characters in
the label.
As discussed in #14598, there are now two tabs instead of the
checkbox: "Featured packages" and "All packages". It otherwise
behaves as before.
Also fixes#12428.
Currently using the LEGACY_TX path as the newer one requires mtx_trylock()
and "curcpu", which I haven't implemented yet.
Completely untested as I don't have this hardware.
* init_hardware is unnecessary and mostly a duplicate of init_driver;
so just remove it in favor of that.
* Deduplify some of the _DRIVER macros as possible
* Don't include net_stack.h, we don't need it here; and fix
callout.h following that.
* Fixed colour localization on test page
* Changed JobListView to use plural placeholders
* Changed PrintersWindow to use placeholders
Change-Id: I39477351364a0182cf629476de767af18f9c0d61
Reviewed-on: https://review.haiku-os.org/524
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
This addresses some of what's reported in ticket #14637.
* Keymap preferences: Localize key labels. Translators have
to be careful not too use too long words here...
* Media preferences: Fix typo "SoundFonts" -> "SoundFont"
The two popup menus, Video input/output, both use "<none>",
which when the catkeys are collected is reduced to one item.
Apparently, Italian likes to have different tranlsations for
them. I hope to fix that by using B_TRANSLATE_COMMENT with
differing comments. Not sure if that'll work...
* Network preferences: Localize "on/off" and "Enable/Disable"
in the Services.
* Repositories preferences:
Add RepoRow.cpp to DoCatalogs.
* Shortcuts preferences: Localize "Left/Right/Both/Either/None"
* Bluetooth replicant: Localize menu items and alerts.
* DeskCalc: Localize button names.
* HaikuDepot:
- Use BStringFormat and variables to replace for the WorkStatusView.
- Put package name in single quotes; nicer if you have package names
with spaces.
- Avoid leading and trailing spaces in translatable strings. Those
can be overlooked b the translator.
- Use B_UTF8_ELLIPSIS instead of "...".
Change-Id: Ia32908f9faad5188aa87c918c31229277decbda9
Reviewed-on: https://review.haiku-os.org/631
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Since index's type is uint8 (range 0-255) and kTermColorCount set to 256
(declared in terminal/Colors.h at line 31), 'index < kTermColorCount' is
always true.
Pointed out by clang.
Change-Id: I49e45cbd8a55223177fd2d6a64a0e37cf6341fc7
Reviewed-on: https://review.haiku-os.org/637
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
* I have not idea what this is for. Seems stuff from a long time ago
when for some reason someone wanted an audio driver implemented in
a kernel module. It is not used anywhere. If someone feels this should
be reverted please let me know and add an explanation.
* This media_add-on was provided to support the old
BeOS audio API (R3?), it is not working and will probably
not work on anything enough modern to run Haiku.
Modify if condition, since:
1) Comparison of array 'current->buffer_log' equal to a null pointer
is always false. Pointed out by clang.
2) XHCI::CreateDescriptor() sets buffer_log[0] to NULL,
when bufferSize <= 0.
Change-Id: I9a632dcf9c41435653b0556ed981d78bab846038
Reviewed-on: https://review.haiku-os.org/638
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This fixes the KDL while loading iprowifi2100 w/o firmware installed.
Full explanation:
1) device_attach calls start_wlan
2) start_wlan fails, because lack of firmware
3) ... -> device_detach called (from device_delete_child)
4) it calls stop_wlan that faults with BAD_VALUE
5) we leave device attached... then uninit_mbufs called -> KDL
Change-Id: I18d06ea7be48e569838f17e3779d054000898043
Reviewed-on: https://review.haiku-os.org/635
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* Move MMU image to a real image define vs being crammed into
the u-boot bootloader Jamfile
* ARM not working yet, but better!
* x86 still builds
Change-Id: I3fb873dbac06fe2db893915b667bf3ce1df44686
I rewrote the "config.h" at the same time, which enables usage of gettimeofday
and some other API functions we didn't have whenever this port was first done,
enabling more accurate timestamp handling, among other things.
Probably this was a copy/paste error from the "FAST_INTR" method
which did not return handled information (and was removed in FreeBSD ~8.)
Note that this is a *major* change, as our interrupt scheduling system
puts "no handling information" interrupts last, and so it's possible
this unbreaks some of the more esoteric chipsets.
But it's also possible that our interrupts glue code for some of the
drivers is incorrect, and so this will break other devices on the same
interrupt line. Please test carefully.
* haiku_loader is the hpkg name in system/packages and not the
loader name.
* bios_ia32 stage1 assumes the bios_ia32 loader is the first
file in haiku_loader.hpkg. This isn't ideal.. but space in
stage1 is *limited*
As the IMAP connection handler disconnects when idle, it loses the
folder state at that time - however, it wasn't resetting it's internal
folder selected flag. This is now fixed.
Change-Id: Ib56f55664ab5d7383a13705a8f4a8585b29f2c92
Reviewed-on: https://review.haiku-os.org/627
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
In XXorRegion(), memory allocated in if statement might be leaked.
Pointed by Clang Static Analyzer.
Change-Id: I6b8b68bc5fea7b7c1fd354f05f03d3ebb0b11b62
Reviewed-on: https://review.haiku-os.org/633
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
This replaces the one in the "playground." It's identical to the current
kernel implementation, except with the few VFS functions replaced with
Storage Kit calls.
Userland packagefs will need this.
In AddResource(), parameter 'index' is not used.
It seems AddItem() use index instead of count.
Change-Id: I997ac96b7d32c5705606cdbf23c7fd71550c9aa6
Reviewed-on: https://review.haiku-os.org/630
Reviewed-by: Rene Gollent <rene@gollent.com>
check_path_name() had NULL check of path, but its result was not used.
So, add if statement to return B_BAD_VALUE when path is NULL.
Change-Id: I8ceec5d592267bf0f00f606eba44c0ecaef5a209
Reviewed-on: https://review.haiku-os.org/628
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Suppress -Werror=class-memaccess pointed out by gcc8.
* Remove unneed memset(), since media_format is cleared by constructor.
* Use media_format::Clear() instead of memset()
Change-Id: If905db6c0b7d759e72cfa649951be5109f952f54
Reviewed-on: https://review.haiku-os.org/485
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
Fixes#13768.
Change-Id: Ia783e62a15917a2c8f7b3169ee5204a8d8d6f5ef
Reviewed-on: https://review.haiku-os.org/622
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: Alexander von Gluck IV <kallisti5@unixzen.com>
Unfortunately reference data is not downloaded
from HDS to HD (it is being worked on) and in
the meantime somebody wants to work with Italian
translations so this will add Italian into the
list of hard-coded supported languages.
Change-Id: Ie0b923ce60acd473cbbea5bbac2254402d7a8fdd
Reviewed-on: https://review.haiku-os.org/618
Reviewed-by: Humdinger <humdingerb@gmail.com>
The "mount" command which calls fs_mount_volume direclty handled this
properly, but this class did not; which meant that user-visible error
messages about partitions failing to mount just said "general system error"
instead of the real one.
Fixes#14540.
This is Haiku's first 10Gb ethernet driver, ported upon request
by kallisti5. It's completely untested (I don't have this hardware),
so for now it's not been added to the image.
This commit resolves a problem where a user would be
unable to rate an installed packge.
fixes#14554
Change-Id: I3141eaebbdf531f17eb05302a536c6e0d722a164
Reviewed-on: https://review.haiku-os.org/611
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Performance improvements for the application updating
lists of packages when the user is operating with the
locale set to Russian.
fixes#14513
Change-Id: I1e2514a2afbd43503ac0edfe280a856411738026
Reviewed-on: https://review.haiku-os.org/612
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit resolves a problem where the user-rating
is able to specify a rating (how many stars) or not.
The behaviour was not properly honouring the checkbox
to specify if the rating was to be used or not.
Change-Id: I01067bf899e1d5beab1474a197c5698166b9f582
Reviewed-on: https://review.haiku-os.org/600
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* Fixes#13119
Change-Id: Ia75f06c61476324951d44cfe2a1b281bf014b5f4
Reviewed-on: https://review.haiku-os.org/607
Reviewed-by: Alexander von Gluck IV <kallisti5@unixzen.com>
Changes the logic flow around reverting the position of
the request / response buffers when the buffer is logged
during trace logging.
Change-Id: I025ca9988b32447e225e3ad1b1d4da1174d2d122
Reviewed-on: https://review.haiku-os.org/599
Reviewed-by: Rene Gollent <rene@gollent.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Corrections to some areas where the 'position' of a
data stream was not being set correctly before reading.
Change-Id: I0030a113008028d5480dc36d034cf06915d928de
Reviewed-on: https://review.haiku-os.org/588
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
getsockname() now set the socket family and zero all other fields
of sockaddr if an unnamed socket is passed as an argument. This allows
retrieving the socket family from an unnamed socket.
This change is compatible with POSIX and appears to aligns with
Linux, FreeBSD, DragonflyBSD and OpenBSD behaviors.
Fixes#14312
Change-Id: I55dbf4d6738399941bef71e6b3d7201cf78876df
Reviewed-on: https://review.haiku-os.org/594
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Fixes#13622.
The "media_node_framework" is such a huge mess. We really should sit down
and design a MediaKit2 someday that doesn't require ~15,000 lines of media
node support code just to have a "fully functioning media player."
It seems to be as if not faster than the built-in method now as far
as I can tell, and this means one less arch-specific difference.
I haven't ripped all of it out yet, though.
It has been deprecated since FFmpeg ~3.0, and is internally implemented
using these functions now, so this should largely be a no-op change.
AVCodecEncoder still uses it.
All of the functions it calls are deprecated and no longer needed,
as FFmpeg loads all codecs automatically now, and uses pthreads internally
for locking as needed.
From mmlr's analysis in #13370 comment:22: "We actually do ignore a missing
routing in case the interrupt line is 0. In this case it isn't 0 but 0xff,
which is invalid and generally treated the same as 0 in the rest of the code.
Ignoring the missing routing on 0xff seems like the way to go here."
Indeed, I managed to locate a footnote in the PCI 3.0 specification which
confirms that this is the case on x86, and a commit in the Linux kernel
which essentially does the same thing this change does:
https://github.com/torvalds/linux/commit/e237a5518425155faa508a087f2826
Interestingly, that commit is only from 2016, while PCI 3.0 is from 2004.
This probably fixes#13370 ("Haiku doesn't MBR boot on Ryzen"), and potentially
other interrupt-routing-related boot failures.
Change-Id: I88129f6507c62d24cb50cf5c78597ca7bd7872d7
Reviewed-on: https://review.haiku-os.org/590
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* There was an off-by-one error in initialization code;
BRect(0, 0, 15, 15) does not create 16x16 bitmap - it is 15x15.
As a result vector icons were rendered at 15x15 and then scaled to
16x16.
Change-Id: If1b57148e5a887a4bf71e01606d3d0d6fd0ed149
Reviewed-on: https://review.haiku-os.org/585
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
We do not know anything about the symbols we are being asked to demangle;
it is entirely possible they are malformed, or that we parse them incorrectly,
which previously led to buffer overflows. E.g. the "2","8" in "SetTo__Q28_GLOBAL_"
is presently incorrectly parsed as a length, leading to an access 21 bytes past
the end of the string.
This caused a page fault under the guarded heap, a fact I had the misfortune
to discover when trying to attach Debugger to a guarded-heap'd application
which somehow ran the demangler under the guarded heap also, and that symbol
above was in runtime_loader, so it crashed while loading its symbols.
So now we do what the GCC3+ demangler does here, and keep track of the input
buffer through the use of a state class, which will prevent us from incrementing
past the buffer's end.
I've tested this patch using the new haikuc++filt utility against libtracker
(indeed, it took multiple rounds of testing to get the diff to be 0 bytes)
and it seems to work exactly as before, though now without out-of-bounds
accesses.
As this demangler is also used in the kernel, it's possible that some
triple-faults on x86_gcc2[h] are caused by this bug (although that would
be rare; one of the incorrectly-parsed symbols would have to be in the
stack trace, and then it would have to read past the end of the buffer
containing the symbol.)
Change-Id: I343991cebd7d2887812c8c6b3dc2e0df2fcd79fa
Reviewed-on: https://review.haiku-os.org/579
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Built as "haikuc++filt" so you can keep it in PATH without replacing GCC's.
The implementation is a very close copy of "demumble", which is
under the Apache 2 license, so this is also. Most of the modifications
to "demumble" were to strip out Windows symbol support, and then
add GCC2 symbol support (this required reworking of the main loop,
as we detect GCC2 symbols in a different way than Itanium symbols.)
I've also added a command-line flag to ignore GCC2 symbols when stream-
processing, which is sometimes useful when demangling GCC3+ symbols.
Running this under guarded heap with some random SOs shows that there are
some symbols which apparently cause memory corruption in the GCC2 demangler.
I haven't yet looked into that, though.
They may still be running at the point we detach from the window, and
as we stop watching everything else at that point (and the threads
themselves depend on the window looper as the global "lock"), we
need to tear them down then.
We especially cannot do this in the destructor, as there are some
virtual methods that the threads need during their teardown which
obviously will not work in ~BPoseView.
Fixes#13371, and potentially other Tracker crashes that occured
as a result of closing the window while the add-poses tasks were
still operational.
Change-Id: Ib7ec0d1d413096be899a05887399f5b087eb8f99
Reviewed-on: https://review.haiku-os.org/574
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Fixes the tests added in the previous commit, and also #8552.
Change-Id: Idf9459474bc66054f94cf66065ed6fcf9c60cece
Reviewed-on: https://review.haiku-os.org/572
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
BeOS R5 treats NULL passed as the "replace with" argument as if it were
an empty string. Our BString currently does nothing.
Change-Id: I54b661e4ea8335ce531e6b6e3de2095a41112cd7
Reviewed-on: https://review.haiku-os.org/571
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
The action vm_page_fault takes should depend on whether the iframe to be
handled is a user iframe or not. The check for the user flag in the
error code does however only check if the fault happend in user or
kernel space. Use IFRAME_IS_USER() instead which checks the privilege
level of the iframe. Under 32 bit x86 this also handles vm86
compatibility mode properly.
This is the same logic as used on FreeBSD (TRAPF_USERMODE).
Fixes#13930.
Change-Id: I9c348b6ab4c60daaaaa2c0fe33bcc3336aa29f7b
Reviewed-on: https://review.haiku-os.org/560
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Patch by Pete Goodeve, ticket #9134.
(Removed play_sample_rate and record_sample_rate as suggested in
patch review, adjusted hda.settings accordingly.)
Tune buffer size and buffer count with an optional settings file
/boot/home/config/settings/kernel/drivers/hda.settings. Same as
it's done for the auich driver.
Pete:
> I [...] request 4 buffers of 1024 frames, I get a nice 13-14ms latency.
Change-Id: I3c1c64375d22b525afb970d5e8379b22b8514438
Reviewed-on: https://review.haiku-os.org/521
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Thanks Axel and Jerome for the reviews!
Change-Id: I4f116c540cf59ba74b79d9d2f95ed40edc9c4174
Reviewed-on: https://review.haiku-os.org/557
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Fixes#12034, and a variety of other strange "no wireless networks
appear" bugs that have plagued Haiku for years.
Change-Id: I734cb8084e8a626b8e03511519609bf80c1559eb
Reviewed-on: https://review.haiku-os.org/552
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This depends on the previous commit to return the correct error code
from ioctl().
If there are no VAPs running (which is the case after a forced disconnect
from an access point), scans will fail. In that case, we call
IEEE80211_IOC_HAIKU_COMPAT_WLAN_UP, which will restart a VAP, and then
initiate the scan.
Change-Id: I732aefe67e386dbb0ed3d232ed9deda678132601
Reviewed-on: https://review.haiku-os.org/551
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Previously, if a device driver returned an error of any kind, -1 was
propagated the rest of the way up through the stack instead of the
actual error code.
Change-Id: I6839763c6b2eb86d6112d3732e6cb80d022f1fe8
Reviewed-on: https://review.haiku-os.org/550
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* _VirtualWidth() ignores invisible columns
This makes the horizontal scrollbar match the width of the visible columns.
Also trigger an initial update of the scrollbars.
* Fixes#14480
Change-Id: I7d4b27a8fdca58c150ac47f9b948b127fb275fdf
Reviewed-on: https://review.haiku-os.org/543
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
This fixes the (intermittently) crashing test added in the previous commit,
and should also fix#12024 and #14348.
Note that this is a slight behavioral departure from BeOS, though since
BeOS crashed when this was done previously, it shouldn't cause any
other problems.
Change-Id: I90b6132ff7741b8d6cb601375a9b11fc3ffacb40
Reviewed-on: https://review.haiku-os.org/541
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Adds/removes items as rapidly as possible from the menu from the
main thread while the menu is open. That part works. Then it deletes
all of the BMenuItems and then closes the menu, which crashes,
as the BMenuItems do not notify the BMenu they are being deleted.
I tested this on BeOS and it seems that this model crashes there also
(looking through the code comments, it seems there are a number of
testcases found throughout the years like this.) Removing the items
before deleting them indeed fixes the crashes on both BeOS
and Haiku.
Change-Id: I8624f966bdc17030ddca05b97aa57b518ab420c5
Reviewed-on: https://review.haiku-os.org/540
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
...if the row is present in the list, but continue to return false if the
row is not currently visible on the screen.
Part of #11675. Cherry-picked from https://review.haiku-os.org/442.