* Works under a Linux "cross-compile" environment
* We can't check in compile_commands.json unforunetly because it
highly depends on your build environment
* An in-tree .clangd is a thing, but our includes are complex
and directory-spefific.
* Thanks to Pulkomandy for adding the flag to jam to do this!
Change-Id: I3be4084c43f7b822bb04ea7ec527c5fbe03d7289
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7158
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
If you don't have a selection, Get info on the window instead.
Change-Id: I83db030798788a487ce3123bb8b2c25056d4fbf2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7170
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
... instead of "4096 bytes" (i.e. 1 block).
Set total_blocks to 0 in packagefs_read_fs_info to indicate
that the capacity is 0, this avoids some potential issues
that using 1 or -1 might cause.
In WidgetAttributeText look for volumes with 0 blocks and
set fValueIsDefined to false which displays a "-".
Also replace capacity string with "-" in Get info.
Fixes #10291 the quick and dirty solution to #18567.
Change-Id: I7ff204c9ffd10cf9cc6343fcdd4422c034004004
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7164
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: John Scipione <jscipione@gmail.com>
Call TargetModel() instead of PoseView()->TargetModel(), shorter
Eliminate duplicate method in FSUtils. Call FSIsRootDir() in a
couple of places instead of looking for "/".
Change-Id: I42b7f39e7708eda107ee479a6cd36cb58ac77ad9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7172
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
... when context-click on a volume in Open/Save dialog.
Regresssion introduced in hrev56978. Separator goes with the
Paste item that is not currently added.
Change-Id: Ic9402cae27ed84f15479ee9b9cc1f48fea806efa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7169
Reviewed-by: John Scipione <jscipione@gmail.com>
* Of note, using the Linux version since this tool is
generally compiled on the host system
Change-Id: I85907a09877a97ec6ec709add6f7985b551fcad3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7168
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
We were storing real_time_clock_usecs() but comparing against
BStatable::GetModificationTime() which is just a time_t. The
values were thus displayed wrongly in the "Get Info" window,
but also thumbnails would not have been updated when the file was.
Should fix #18691 and possibly some other tickets.
* Rename the "tun" network device to "tunnel". FreeBSD calls theirs
"tuntap" but speaks of both TUN and TAP devices as interfaces for
tunnels. The other BSDs seem to do likewise.
* Fold the "tun" driver into the "tunnel" network device. The
network device now publishes entries in devfs when interfaces
are created, and unpublishes them when interfaces are destroyed.
This removes the need for the driver and device to communicate
through a file descriptor, and thus allows the receive queue
to be totally eliminated, massively simplifying that logic.
* Use standard net-stack FIFOs instead of TCP BufferQueue, which is
specialized to TCP's needs in far too many ways. Thanks to the
previous commit adding support for interrupting semaphore waits,
we can use the FIFO wait mechanisms, too.
* Restructure the TAP logic, and generate MAC addresses more like
Linux does.
* Actually set type = IFT_TUN, and use the "loopback" frame handler
instead of the "ethernet" frame handler. This allows significant
cleanup of the header handling logic.
* In TUN mode, reject packets that don't look like IP packets.
* Delete "tunconfig"; it was mostly stubs and is now unnecessary.
TUN mode tested and confirmed as working by kallisti5 with OpenVPN.
TAP mode partially tested, but not yet confirmed as working.
Fixes #18673.
Change-Id: Ibd803139474e8db556a4f567901da15ee4083621
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7143
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Previously, "count" did nothing for B_RELEASE_ALL. Now, if it is
< 0, it will be the error code returned by acquire_sem() of any
waiting threads.
As B_RELEASE_ALL is a Haiku extension, this change should not
cause any compatibility problems that we cannot fix.
This will be useful in implementing some features of TUN/TAP
with network FIFOs.
Change-Id: I2dbccedefac2024fe740b87543ff3b80f5257e20
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7163
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This change includes some changes to the
generated DTO models between HaikuDepotServer
and HaikuDepot which should improve
performance.
Change-Id: I74c6014f8115aa0a55907a24b6115dd48d341794
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7165
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
* Pointed out by clang static analysis. These are
later read while not being completely validated.
Change-Id: I4546526535d6e011aee40c74136f992962ab8cff
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7159
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Without functionally changing the generated
code, create a new mechanic for generation
in order that improvements can be later made.
Change-Id: Ieb420f2eb0fee51c266ab2e0734ec5c298640cfa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7156
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
* Reshuffle variable declarations, most are placed much
closer to first usages now.
* Turn a confusingly worded comment into an ASSERT(),
and remove another one that was outdated.
* Fix some minor code style problems.
* Make the copying logic more consistent between first
and then subsequent copies.
* Make it possible for B_BAD_ADDRESS (EFAULT) to be
returned. This is not listed in POSIX, but as per
online sources, at least Linux does do this.
Change-Id: Idcfbed30531c1ab4796c4ee37f7f4ce8078e535b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7147
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
When adding two successive spans with identical styles, they should be
merged into a single span. However, all prevous spans in the view were
accidentally removed.
Change-Id: I4b2d21331ba97cf54a0db83e7638e23bd2303a63
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7128
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This is a Linux extension (which at least FreeBSD has also
adopted.) It's used in the Haiku port of libpcap (where it's
a necessity) and wpa_supplicant (where it wasn't, and I
removed it.) It seems that we've had it for quite some time.
Fixes tcpdump following addition of flag checks.
Set MENU_STATE_KEY_TO_SUBMENU on up arrow as well as down. This
causes the menu to check if there is a selected item even if you
aren't hovering over the menu. Previously we were doing this for
the down arrow but not the up arrow which caused a subtle bug that
humdinger stumbled upon in Deskbar where if you push the Menu key,
up, then Enter, the menu item is not activated, but if you push
Menu key, down, then Enter the menu item is activated.
Fixes #18686
Change-Id: I8dce6112603e12fb47afebb48a33b3ec6fa60230
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7140
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Although I can't reproduce this crash, from the looks of the crash
report something in the CanEditName() method is throwing a
segmentation fault.
If selection count is not 1, don't even try to get the selection,
Edit name is not allowed unless you have a single item selected.
Double check that selected item is not NULL before using it.
I refuse to believe that fSelectionList being NULL is the problem
here, more likely fSelectionList->FirstItem() is NULL and is the
cause of the crash. Bailing out after checking that selection
count is 1 should ensure that FirstItem() is not NULL.
Hopefully fixes #18684
Change-Id: Ib99192178fa6f6d31b389afb47e72c5513e6e1c6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7139
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
TargetVolumeIsReadOnly() doesn't make sense here because we
know the trash's volume is not read-only, we need to check
that you have a selection to enable Restore. Currently
(since hrev56978) Restore option is always enabled but it
shouldn't be if you have nothing selected.
It would be nice to also check if the restored location is
not read-only because you put something in the Trash then
remounted the volume read-only, but that's too much work.
Fixes yet another regression from hrev56978.
Also missed a delete convenience method call in hrev57402.
Call CanMoveToTrashOrDuplicate() to check if delete is allowed.
This method does a bit more work, it checks if the selection
includes the Desktop, the root volume, or the trash itself
which you are not allowed to delete.
Otherwise the same, this shouldn't make a big difference.
Change-Id: Ie188f25bd969a5aaeec9ff397fa5750872ccf97f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7138
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
GCC2 tolerates [] FLAs in C++ mode but not in C mode, as discovered
when trying to build wpa_supplicant against R1/beta4. A workaround
was added there for now, but this is the more general solution.
Regression was introduced in hrev56978 (Tracker read-only patch)
after R1B4.
This check is bad on Copy To/Move To operations because destWindow
is same as source window in these cases. This check only worked on
right-click drag Copy here/Move here since there is a separate
destWindow in this case.
Checking destFolder's volume read-only fixes the regression
because destFolder, unlike destWindow, should always be valid.
Fixes #18657
Change-Id: I4721bae34840d916e47f2a395d553e7254acaec5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7137
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Without functionally changing the generated
code, create a new mechanic for generation
in order that improvements can be later made.
Change-Id: If5b755ebd257658ab0e0a0045dd21a464b429c09
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7135
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
These have not been used in years (maybe since the redesign of the
network stack?). Only socket_writev had an implementation, which was
mostly just an incomplete version of socket_send.
Scatter/gather I/O is already supported via msghdr's msg_iov/len fields,
so this is redundant anyway.
Change-Id: If41c4f4ee021856f6db49c7cb95422a9c1aa7700
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7127
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
The original Linux extfs was short lived (less than a year) and is long
forgotten. Still, to avoid any confusion, it's better to refer to our
filesystem as ext4 (even if it is backwards compatible with versions 2
and 3).
Mention all 3 versions in the "pretty name" to be even clearer about
this.
Previously this was called "ext2" but people then assume that it does
not handle the later upgrades in versions 3 and 4 (which makes sense).
They only described things that the function names and parameters
already indicated. As per the Coding Guidelines, such excessive
commenting is to be removed.
Also fix some other (minor) code style issues while at it.
"LGTM" code scanning was bought out and merged into GitHub Actions.
The code scanning setup there has a different mechanism for configuration,
and so this file is not useful anymore.
The filesystem name returned by read_fs_info will be correct (i.e.
returning "ext3" or "ext4" as appropriate), but some things just list
the filesystem driver's name, which can cause confusion.
Change-Id: Ic4acf497fc5db5c167131aeb323b45eeb78594d6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7126
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
... and a few minor feature updates.
Create a CanEditName method on PoseView because we were using
subtly different checks in different places to see if allowed
to edit the name or not.
Tint background color of the Edit name text box on read-only
to indicate that the file name cannot be edited (only copied).
Create ReadOnlyTint() method in Utilities and use it here and
in PoseView to set the background color. Eliminate BackTint()
method from PoseView which served a similar purpose.
Add CanMoveToTrashOrDuplicate() convenience method.
Move To Trash, Delete and Duplicate options use same check.
Context menu of selection in file panel gets Duplicate option,
window context menu never did so don't try to enable it there.
Change-Id: I7a82d00ea10f22a7885c2e898a809e1abe9a6b30
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7122
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
If 0 items are selected, check the window's volume instead.
If 1 item is selected, check if the parent's volume is read-only.
If multiple items are selected, consider the entire selection to
be read-only if any item's parent directory in the selection is
on a read-only volume.
You aren't allowed to for example Cut a selection that has an
item on a read-only volume as the Cut operation would not be able
to succeed. However, if all items in the selection are not on a
read-only volume then you may Cut.
For non-query windows assume all selected item's are on the same
volume and only check the first item when multiple are selected.
Fixes #18661
Change-Id: Ib898e54b62558c66aad65d33afd080480e312565
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7120
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: John Scipione <jscipione@gmail.com>
This removes the burden of determining whether to and then
actually sending SIGPIPE from the protocol modules, meaning
the MSG_NOSIGNAL flag can now be implemented entirely in
the socket module and not even passed further down the chain.
Change-Id: I9ba976c4aff60d533cb4b390bbba1560c0de423f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7124
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Fixes WebKitGTK spinning endlessly and spawning lots of
short-lived worker processes following the addition of
flag checks and EOPNOTSUPP to the various socket modules.
Change-Id: I6d944b4d0235eea9e8a9333645fcb531805f340f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7123
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Its declarations were moved from another header to this file
in 2008, with a comment in the commit message and a TODO here
questioning whether it was needed for anything. In the 15 years
since then, nothing has used it.