Commit Graph

59888 Commits

Author SHA1 Message Date
Augustin Cavalier
06d77ca653 libnetwork: Remove not-so-useful printf.
We don't really need to see in syslog when an application is
running in R5 compatibility mode.
2019-02-02 14:20:16 -05:00
Augustin Cavalier
8270254464 libnetwork: Rename find_own_image() to set_own_image_location().
Thanks Axel for the review!
2019-02-02 14:01:30 -05:00
Augustin Cavalier
d65ffc926c libnetapi: Remove __gNetAPIStart.
Not used by anything.
2019-02-02 13:26:18 -05:00
Augustin Cavalier
67ef9f72fc network: Utilize image_id argument to initialize_before.
We don't need to search for our own image_id, we already have it now,
so just use it.
2019-02-01 20:33:41 -05:00
Augustin Cavalier
c5e4e4ffb4 headers/kernel: Include declarations of initialization functions in image.h.
No "real" functional change, but this causes GCC7 to throw errors when
these functions are declared without the image_id argument, which
in some files they were (as this commit repairs.)

This change is largely inconsequential on x86, but on callee-cleanup-args
targets, leaving out the argument would probably cause stack corruption.
2019-02-01 20:30:39 -05:00
Augustin Cavalier
d545ad17ce headers/kernel: Define B_CURRENT_IMAGE_SYMBOL via __func__.
Previously, __haiku_init_before was a symbol that was included in
each (shared) object, and so it could be used to determine what
one we were in. Now, there are no such universal symbols that
are declared private to only the object, so we have to use
a different approach.

__func__ is defined as a const char* at the very beginning of
every function it's used in, set to a string of the function name
only, i.e., the arguments and return type are left off. So while
including that is perhaps not quite optimal, in practice this
definition is used extremely rarely (it was introduced by Haiku,
and it is used in only 2 applications at all that I could find --
WebKit and Canna.)

There really isn't any other way to get a pointer that we know
for certain is within the current object besides this one
without inserting one, but that really isn't merited just for this.
(__builtin_return_address() has problematic semantics wrt. inlining,
including linker-inlining.) So this will have to do.
2019-02-01 20:24:31 -05:00
Augustin Cavalier
475172337b headers/kernel: Move B_WAIT_TILL_LOADED to a syscall header.
It is only used as an argument to _kern_load_image directly, not to
any of the load_image functions in image.h, so it belongs in a syscall-
specific header like other such constants.

No functional change intended.
2019-02-01 19:45:56 -05:00
Augustin Cavalier
04b9fbfdfa headers/kernel: Clean up image.h.
* Add missing whitespace.
 * Remove definition of the now-gone __haiku_init_before.

No functional change intended.
2019-02-01 19:20:25 -05:00
Augustin Cavalier
a396188f23 BSound: Add explicit cast to bigtime_t.
Fixes the GCC2 build.
2019-02-01 11:30:08 -05:00
CodeforEvolution
aad79bda85 Implement Duration() in BSound
Change-Id: I45244cd958acd7856a065af01625d2164b9ad033
Reviewed-on: https://review.haiku-os.org/c/963
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-02-01 15:49:07 +00:00
Rob Gill
5186fb7ebd Network: Avoid DHCP over-writing user specified DNS settings
* Adds parser to servers/net/nethost, to check current
   settings in resolv.conf before updating

   If user has specified DNS settings manually, DHCP derived
   settings are appended to resolv.conf, rather than overwriting.

   (If no user specified data is present, or in the event of
   a badly damaged resolv.conf, DHCP over-writes file in same
   manner as prior to this change)

Fixes #11565.

Change-Id: I43464909009d2416d57f66f7bd14d13c81f803e7
Reviewed-on: https://review.haiku-os.org/c/997
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-02-01 08:59:48 +00:00
Augustin Cavalier
f7e2391702 XHCI: Use InitKernelAccess/PrepareKernelAccess properly.
* Actually check return codes of InitKernelAccess().
 * WriteDescriptorChain accesses the memory in the IO vectors, so
   we need to PrepareKernelAccess before calling it.

Fixes #14752.
2019-01-31 22:48:04 -05:00
Augustin Cavalier
32d4274178 kernel/team: Use a rw_spinlock to guard the sTeamsHash.
Virtually identical to my prior change to sThreadsHash.
2019-01-31 20:09:10 -05:00
Augustin Cavalier
5796ecc706 kernel/thread: Add proper permissions checks.
* Add a utility thread_check_permissions(), which takes the target
   thread, the calling thread, and whether or not this is a "kernel" call,
   and then returns whether the target thread may be legally modified.
 * Refactor all calls that operate by sending a signal to the thread
   into a single thread_send_signal() utility function, which now uses
   thread_check_permissions() appropriately.
 * Manually add the permissions checks to other functions as needed.

Solves a bunch of decade+-old TODOs.
2019-01-31 20:05:39 -05:00
Augustin Cavalier
d745129c7a kernel: Mark TeamThreadTable::GetIterator() const.
We use it only while holding a "read" lock, so it must be.
2019-01-31 20:03:28 -05:00
Augustin Cavalier
8140719777 WebPositive: Use spinners for font size options.
Fixes #14845.
2019-01-29 13:31:09 -05:00
Humdinger
e705c841d7 Fix URLs in the development docs
* Fix dead links where possible
* Use online instead of local links to the BeBook

Change-Id: I250117dcccc0026925c56545cca7e3b4467f2c78
Reviewed-on: https://review.haiku-os.org/c/811
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-01-29 16:12:55 +00:00
Rob Gill
80cdc887fa apps/pulse Fix PVS-2010
*	Replace unformatted printf with puts

	*	removed extraneous spaces

Change-Id: I5c707a22dca703bf6a594ab6e85dc2c24bc3911a
Reviewed-on: https://review.haiku-os.org/c/966
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-01-29 16:11:52 +00:00
Rob Gill
d27546c10f kits/interface Fix PVS902
*	replace unformatted printf with puts

Change-Id: I06b5f436bf51423c60ddd3cc81d86217d06c78cd
Reviewed-on: https://review.haiku-os.org/c/961
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2019-01-29 12:20:56 +00:00
Rob Gill
d7e7e13c67 apps/networkstatus Fix PVS966
*	replace unformatted printf with puts

	*	also add translation for one error message

Change-Id: I48f65af633a39c5f7d4ab359ec8b648c9b869fd4
Reviewed-on: https://review.haiku-os.org/c/962
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2019-01-29 12:20:00 +00:00
Rob Gill
b726920e3f apps/codycam Fix PVS1347,1348
*	Replace unformatted printf with puts

Change-Id: If4e41bbc58e8a03fdcbee3f2d2efc0a9ff9fc2a2
Reviewed-on: https://review.haiku-os.org/c/965
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2019-01-29 12:18:43 +00:00
Rob Gill
2f8e8732e1 mime_db Add additional disk image types
*	Two disk image types added to the mime_db with sniffer rules

		1	x-intel-image as a generic type for images using an intel
		partition style boot sector
		2	x-ntfs-image a specific type for ntfs format image files

		Default handler for these types is set to mountvolume, which
		handles ntfs and fat images detected by these sniffers,
		in the same manner as bfs images detected by x-bfs-image.

Change-Id: I994fa23bcc988c40a098aa106587e75d9e1f9b4b
Reviewed-on: https://review.haiku-os.org/c/964
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-01-29 07:28:35 +00:00
Rob Gill
434c347111 headers/libs/agg Fix PVS 33
* Fix successive assignment of 'da'

	* also trailing whitespace removal

Change-Id: Ic127150c18c042839d4104ccc5830adf19550399
Reviewed-on: https://review.haiku-os.org/c/954
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-29 04:04:01 +00:00
Rob Gill
d1f885b435 headers/libs/agg Fix PVS 11, PVS12
* Replace hard-coded math constants with M_SQRT1_2
	(math.h was already included)

	* also trailing whitespace removal

Change-Id: I5e9511060d2f812830f7621bee3aff9a517576e5
Reviewed-on: https://review.haiku-os.org/c/956
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-29 04:02:25 +00:00
Alexander von Gluck IV
cf77ef1857 haiku_loader: Toss iSCSITarget, add TCP stack to loader.
* This iSCSI implementation only worked on PPC big-endian atm.
* We're pretty sure iSCSI support in haiku_loader doesn't make
  much sense anymore. iPXE on (on arm,x86,etc EFI/BIOS platforms)
  supports iSCSI boot of disks.
* Haiku could use a iSCSI driver add-on, but it would exist much
  higher up and likely use standard drivers vs bare-minimum iSCSI
  target impementations.
* Leaving TCP and adding to all arches since it could make sense
  for haiku's native network disk subsystem or network debugging?

Change-Id: Ic181b93a1d8ffd77f69e00e372b44b79abbddb42
Reviewed-on: https://review.haiku-os.org/c/899
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-28 16:47:08 +00:00
ahenriksson
c3c2596d9b fs_shell: Add sscanf and vsscanf
Change-Id: I0f69ebb6bc12bb68488a0d0bdaa7b86f5b06bb99
Reviewed-on: https://review.haiku-os.org/c/938
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2019-01-28 16:38:27 +00:00
Augustin Cavalier
849f58107a build_cross_tools_gcc4: Enable initfini-array in binutils.
Our implementation of it now behaves properly after the last commit.

Change-Id: I6bebc91ae0f9512ea07ad6a7a4ccea9ee758e01b
Reviewed-on: https://review.haiku-os.org/c/908
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-28 16:37:28 +00:00
Augustin Cavalier
354b60af29 runtime_loader: Rework static initialization handling.
Previously, static initializers were just in ".ctors", which was handled
by GCC's crtbeginS, and that was injected in-between crti and crtn. Now,
however, binutils puts static initializers into init_array/fini_array by
default, which runtime_loader handles, but of course as initialize_after and
terminate_after are supposed to be called *after* all static initializers
are called; and since runtime_loader called init_array after _init, they
were not.

Now, we get rid of the __haiku_init_before/etc. functions, and move their
functionality inside runtime_loader. This is a "soft" ABI breakage,
which is mitigated by adding another ABI breakage (runtime_loader now
returns NULL for the initialize_before/etc. symbols, as otherwise
old applications would have their initialize_before/etc. called twice;
once by runtime_loader, and then once by __haiku_init_before/etc.)

I don't see or know of any reason why an application would want to
get those symbols at runtime, though, so this shouldn't have any
adverse effects.

Change-Id: I42344c63f69c6f8ef260f6c3ca30202b6dfb153e
Reviewed-on: https://review.haiku-os.org/c/907
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-28 16:37:28 +00:00
Rob Gill
d49942867b apps/magnify Fix PVS897 through PVS901
* 	replace unformatted printf with puts

Change-Id: I34eedc08ae9e1e83cb43b4359c557ae6078becb9
Reviewed-on: https://review.haiku-os.org/c/960
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2019-01-28 15:18:09 +00:00
Rob Gill
99fe9c42da apps/install Fix PVS381
* Use explicit type cast

Change-Id: I2d75eaeafcb6d46fbc79489394f0f6eb3af6f8d9
Reviewed-on: https://review.haiku-os.org/c/957
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-01-28 08:46:29 +00:00
Rob Gill
df9641c548 kits/Geolocation Fix PVS404
*	Prevent use of uninitialized 'lon' by checking for successful
		result prior call

Change-Id: Ifbd649a8c0c0c37f285cda11e307013929cefa12
Reviewed-on: https://review.haiku-os.org/c/958
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2019-01-28 07:27:06 +00:00
Augustin Cavalier
187bbba6af mime_db: Fix another typo. 2019-01-27 14:36:56 -05:00
Augustin Cavalier
4854630d29 BScrollView: Resize scrollbars dynamically based on target's B_SUPPORTS_LAYOUT...
...instead of the BScrollView itself's layout flag. Thanks to Adrien and
Kacper for discussion on the mailing list.
2019-01-27 14:35:32 -05:00
Augustin Cavalier
b2d62af35a mime_db: Sniff rule must be on one line. 2019-01-27 13:42:27 -05:00
Andreas Henriksson
ae3a28bef3 BFS: Forgotten initialization in Index constructor
Change-Id: I1406ecb2a5e5ae6df88c63c4b64d3191daec59ac
Reviewed-on: https://review.haiku-os.org/c/914
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-27 18:02:54 +00:00
Andreas Faerber
9091349139 Add syslog output support to bootloader
Broadcast console output as syslog debug messages, stripped of trailing newlines.
Disabled by default.

Patch from #6168.

Change-Id: I1754381477dcde00bdcfa4482017daf5eb682cd3
Reviewed-on: https://review.haiku-os.org/c/912
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-01-27 16:51:32 +00:00
Rob Gill
f551180bf9 mime_db: OpenDocument file types
*	Adds the OpenDocument file types to the mime database
	includes regular files and templates.

*	Adds icons to mime_db and artwork/icons

Change-Id: I55c7f79f53e09d5976e41c4d5a5292fc6be906d0
Reviewed-on: https://review.haiku-os.org/c/900
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-01-27 16:21:22 +00:00
Murai Takashi
4a23a66c83 ICNSTranslator: Fix PVS 2199
Merge two if statements that has same conditional expressions
at line 131 and 138.

Change-Id: I8eb69fc81f723502cfc48e1acbb9bf5e55023150
Reviewed-on: https://review.haiku-os.org/c/916
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-01-27 16:18:58 +00:00
Murai Takashi
1342ec2c91 Storage Kit: Fix PVS 692
Merge two if statements that has same conditional expressions
at line 198 and 201.

Change-Id: I797a77d7f2b88ae2cacd8569fdd09c0d1a19d038
Reviewed-on: https://review.haiku-os.org/c/915
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-01-27 16:18:06 +00:00
Adrien Destugues
20312cfe7b BSecureSocket: cleanup, no functional changes
Change-Id: I3355067efe4c5d71f8656d244e17bb11175600eb
Reviewed-on: https://review.haiku-os.org/c/910
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-27 07:55:55 +00:00
Adrien Destugues
1322d50732 HttpRequest: write whole request to socket
Better performance by using a single write, and some servers may not be
happy about getting so many TCP fragments for the HTTP header.

Change-Id: If7139e2a7748ea423d470676e70bd523a89031b2
Reviewed-on: https://review.haiku-os.org/c/909
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-27 07:55:55 +00:00
Rob Gill
27aefde9fd add-ons/disk_systems Fix printf format - PVS 2049
*	printf type set to unsigned

Change-Id: Ib4a8e1bb56c9e00ce90adef680db651fb17686c0
Reviewed-on: https://review.haiku-os.org/c/901
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-26 20:48:21 +00:00
Adrien Destugues
71aec29751 PPM translator: use a buffer for reading
Reading the file 1 byte at a time from a BFile is very inefficient.
Add a buffer, which makes things a lot faster (parsing a 200x200 image
used to run for a few seconds with 100% CPU use).

Change-Id: Ie2eea819475c9301fbb6102c41fa05ec2d2ca343
Reviewed-on: https://review.haiku-os.org/c/906
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-26 20:46:59 +00:00
Adrien Destugues
58913f60e8 PPM translator: read 1-bit and greyscale files
Change-Id: I0d9de6cb6eca99a78aada00c5299c16668c414f8
Reviewed-on: https://review.haiku-os.org/c/905
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-26 20:46:59 +00:00
Adrien Destugues
5d57984ba5 PPM translator: remove pre-R4 support
Change-Id: I26721cdd767bbf0df2936e97a2af322fed49cabf
Reviewed-on: https://review.haiku-os.org/c/904
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-26 20:46:59 +00:00
Adrien Destugues
32c7f1e79f MIME db: identify ASCII variant of PPM; PBM, PGM files
Change-Id: I05574601bfae0094b7509a123cfd19d7fb02e7fd
Reviewed-on: https://review.haiku-os.org/c/903
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-26 20:46:59 +00:00
Adrien Destugues
72c5a125f1 PPM translator: clang-format
Change-Id: I290f9b369af37d919308759b83c42122f7f309bc
Reviewed-on: https://review.haiku-os.org/c/902
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-26 20:46:59 +00:00
Augustin Cavalier
4bf8cf7a1b DefaultMediaTheme: Properly set control targets.
In removing the "GroupView" class and replacing it with a real BGroupView,
I missed that it its AttachedToWindow() implementation iterated over all
child controls and set their targets to themselves. It seems this is how
the Media Kit gets change messages from them, and so the lack of this
broke changing parameter values. Whoops.

But it seems that changing menu option values has been broken for a long time
(perhaps forever?), as in order for a BOptionPopUp to send messages to anything,
its AttachedToWindow() must be called (as this sets the BMenuItem's targets
to itself, so it can forward the messages.) So now that is fixed too.
2019-01-26 15:36:43 -05:00
Augustin Cavalier
132990ecdc idualwifi7260: Fix logic errors in iwm_pcie_load_firmware_chunk.
* There's no reason to have a while() loop here, because:
    - if msleep returns 0, that means we were woken up by the interrupt handler,
      and we are going to exit immediately as sc_fw_chunk_done will now be 1
      (there is nothing else that sleeps on sc_fw.)
    - if msleep doesn't return 0 (i.e. it returned ETIMEDOUT) then we will
      exit immediately because of the if-test.
   So, just use a single msleep() and then check sc_fw_chunk_done as before.
 * The comment said we were sleeping for 5 seconds, but the msleep was only
   for 1. Before the "sync firmware loading" FreeBSD commit, this was 1
   second and so was the comment, and in that commit the comment was changed
   and the function call wasn't.

The bugs here were introduced in the same FreeBSD commit as the "sizeof" bug
that I merged a fix for earlier.

Possibly fixes failures to initialize uCode on certain devices.
2019-01-25 11:25:16 -05:00
Rob Gill
aa7f93c54c src/apps Code formatting
*	No functional changes

		code formatting changes only

Change-Id: I046ae21d9b288126022fe0bc2ddf827843765e70
Reviewed-on: https://review.haiku-os.org/c/896
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-01-25 12:40:34 +00:00