We were not closing cd/dvd device after eject.
Also changed fDevice member to a local variable, since we only use it in one place.
Change-Id: I169da97501f98e30deded1f5ff53d3bc00459eab
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4247
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Semaphore keys were added to the key map a bit early, before all error
checking had been done. As a result, we could have keys in the map that
would not point to a valid semaphore.
Fixes the root issue in #16741. A previous patch in hrev54878 had
already fixed the panic when trying to access such a key, but it was
still possible to generate one.
Change-Id: I7449e295fdbe2a48b554cbc0508683d042f6ca48
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4240
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Various functions would return an error if trying to use them on the
last page of userspace, as they tested the permissions for the first
byte out of the requested range. Also, the code was duplicated in
several places
- Rename validate_user_range to validate_memory_range. The "user" in the
name was to mean that the range is provided by the user calling the
syscall, but it is a bit confusing, as the function accepts any range
that is either in kernel or in user memory.
- Add a new function validate_user_memory_range that only accepts
userspace memory, and use this one where appropriate.
Change-Id: I135f8d584340f0ba4ae7e4b8cb6f8600fbf3ef2d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4212
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
- Remove Pause/Resume functions. They are not possible to implement (the
server would time out)
- Fix SetContext(NULL) to do the right thing.
Change-Id: I25ba09bb01ea0fe8a85d774611b33be7dc192028
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4245
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
We must keep an untranslated version of the text for use with the
expression parser. Only the key label in the user interface should be
translated.
Fixes#15709.
We have increased the number of default attributes, so the initial size
wasn't enough.
On small resolution displays, adjust the size to not end up with part
of the window outside the screen.
Fixes#15371
Change-Id: Ie59cb3a3f6609eff7d933d0bf0e11f66637d6d10
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2222
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This is in the code to print a text dump of the layout constraints, so
it does not fix any layout problems, but it makes debugging things a bit
easier.
There was some confusion (and a TODO indicating it) in ServerFont.cpp,
because the notion of "font face" from the Be API is partially
implemented using different font manager styles (bold, italic, etc),
and partially by keeping flags in a separate variable for drawing
extra things or modifying the drawing (underscore, strikeout, ...).
The implementation did not actually preserve the extra flags, and so the
underscore face attribute was lost.
Implement the actual underlining of the text in AGGTextRenderer. This
implementation is a naive one so far. In particular there are the
following limitations:
1. Line is drawn over the text - no nice gaps for descents. Ideally, the
line should not touch the letter descents, and leave some space
around them. I don't know how to retrieve the contour - it appears to
me this might require bigger refactoring of this code. I have left in
my experiments commented out in the code.
2. If the text run ends with whitespace, the whitespace is not underlined
as it should. In particular if another text run is drawn next to it
and it's expected that the underline is continuous between the two.
Change-Id: I8d78b8e1eceddff0a7d98e5a49659e7b03fd89a0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3041
Reviewed-by: Kacper Kasper <kacperkasper@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This change aims to clean up the code a little. With explicit permission from Matthijs Hollemans.
Change-Id: Idd6c46b8059ec4674653a0d844502b4c76990726
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4146
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
as pointed out via cppcheck. Fix from upstream.
Change-Id: Idfb59ca86bb4ed3767d8327c145ad348cb645e24
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4216
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
This switches to a new API format "v2" being introduced
on HDS. The version of the application is also bumped
at the same time in order to make a later cut-off point
possible for compatibility.
Change-Id: I577fd143ac9d001171bca7213c82e3280af1c4de
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4217
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
The APIs for this were introduced in ICU 63, so we'll need an update.
ICU 63 does not build with gcc2, so this method is disabled there.
Change-Id: Iabe49509ed6d4e578560d497d3ca336a97db4625
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1874
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Fixes:
* scsi: Fix a bug that caused the device capacity to be set
to an undefined value for some large SCSI devices when
READ CAPACITY (16) was used
* ahci: Fix VPD page reporting so that it does not return
undefined values
* ahci: Set the write bit to true when sending a DATA SET
MANAGEMENT (trim) command to a device. The command would
otherwise fail and time out on some devices.
Improvements:
* scsi: Extend the READ CAPACITY (16) support to also
include logical block provisioning information
* scsi: Prefer READ CAPACITY (16) over READ CAPACITY (10)
on devices that are expected to support this command
* scsi, ahci: Enable trim on SCSI and SATA devices that
are expected to support trim and which correctly report
trim support
* ahci: Redo the implementation of the SCSI UNMAP command
* scsi: Redo UNMAP-related code
* scsi: Add support for UNMAP via WRITE SAME (10) and
WRITE SAME (16) commands
* When copying trim ranges between different data types,
make sure that the values don't change (detect overflows)
* Report the number of trimmed blocks even if the trim
operation fails
Change-Id: Ie5fc993bbbc19546b4308138ba10184bf7b9986a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4157
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Fixes:
* Use uint64 instead of off_t when handling offset and size
of the trimmed range in the fs_trim_data structure
* BlockAllocator::Trim: Correct the size of a buffer
* ram_disk, mmc: Do not trim past device capacity
Improvements:
* BlockAllocator::Trim: Because the received offset and size
are ignored by BFS (the functionality is not implemented yet),
return B_UNSUPPORTED if the range does not cover the whole
partition
* ram_disk, mmc: More accurate calculation of the number
of trimmed bytes
* devfs: Add a uint64 version of translate_partition_access()
Change-Id: I24f4c08674f123ad33a5fef6e28996a4ada6ff0d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4155
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
HTTP errors can have some content sent with them (a message to display
to the user, usually). The package kit would not ignore this and append
the content to the end of the downloaded file. This could result in a
file larger than the expected size, and in that case, it would keep
growing infinitely by adding more error messages to it.
Also add some more specific error messages for some HTTP codes, in
particular, "invalid range" which is likely to happen if something goes
wrong with range requests. Now this case will be detected and the
download will stop.
Change-Id: I18927f361235e9f72a5701c1bd7977abda9e21ad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4210
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Integer overflow caused bitmap buffer creation of wrong size and out of
bounds access when large bitmap was created. Now allocation failure is
reported for large bitmaps.
This prevents app_server from crashing while playing YouTube in WebPositive.
Fixes#16489.
Change-Id: I297aa6e3b79b32a486d297f1239a1fd4397a8a36
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4209
Reviewed-by: Sergei Reznikov <diver@gelios.net>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This update will mean that HaikuDepot is able to detect
install / uninstall actions on packages at the system
level and reflect this in the user interface.
Fixes#15879, #15994 and #15046.
Relates to #11674.
Also cleans up disused code in the WorkStatusView.
Change-Id: Ide2d5d93c2f71915bc7cfe7d3628e5f343e43f35
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4145
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Improvements:
* Introduce new command-line parameters for the offset and length
of the trimmed region
* Introduce a new command-line parameter that must be specified
in order to trim a block/character device instead of a file system
* By default, warn users that trim can potentially destroy data
* Display the number of bytes trimmed even if the ioctl returns
an error
Change-Id: I9eec535abe74f7ef09c927292a120016f4156684
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4154
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Check that the source and destination addresses in sg_memcpy
are not NULL. The absence of this check does not seem to
cause any issues, but I think it is safer to include it.
Change-Id: I2b04f94d5b04735fe9510adfb2400a7598b70bc4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4152
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
ICU's Locale::getDisplayName fills in the locale's name in the form
"language (country, variation)". We are interested in the country here.
Fixes#17081
Change-Id: Icb810dbe2c486d95251d4d06a48dfe3a000fa968
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4206
Reviewed-by: humdinger <humdingerb@gmail.com>
Pose::CalcRect() assumed top is at icon top in mini-icon mode. This
is not true for larger font sizes where the top of the text is above
the top of the icon. Calculate top and bottom based on font and icon
size matching the calculation in TextWidget::CalcRectCommon(). This
fixes a highlight redraw bug in mini icon mode at larger font sizes.
Push Edit name right 2px to match label position (in mini-icon mode.)
Round to integer to help with 1px off bug. Edit name box is still off
by 1px from the label for some font families and sizes.
Change-Id: Ibba897d6f3c7a879631adedada5cd59d2071191a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4204
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>