Commit Graph

5336 Commits

Author SHA1 Message Date
Philip Withnall
15a490755e Merge branch 'wip/lantw/freebsd-socket-tests' into 'master'
socket: Fix get_available_bytes on systems other than Linux and Windows

See merge request GNOME/glib!70
2018-06-11 10:58:25 +00:00
Philip Withnall
262b153c41 Merge branch 'wip/lantw/freebsd-meson-builds' into 'master'
Fix meson build files for FreeBSD

See merge request GNOME/glib!73
2018-06-11 10:53:10 +00:00
Philip Withnall
379e8fd22d Merge branch 'wip/lantw/freebsd-gettext-tests' into 'master'
tests: Set both environment variable and locale when running tests

See merge request GNOME/glib!69
2018-06-11 10:51:35 +00:00
Ting-Wei Lan
293c103a7d socket: Fix get_available_bytes on systems other than Linux and Windows
FIONREAD ioctl on Linux reports the size of payload on UDP sockets.
However, other systems usually add internal header size to the reported
size, which vary between different operating systems and socket types.
To make it work on more systems, we should follow what we do on Windows
instead of using this unreliable FIONREAD ioctl.

This fixes socket test on FreeBSD.
2018-06-09 10:02:50 +08:00
Ting-Wei Lan
a77790330b meson: libelf.pc is not always available
libelf, just like libc, is not a single project. It is an interface
which can be implemented independently by different operating systems.
Therefore, we cannot expect all systems to provide a .pc file, and we
should fallback to cc.find_library and cc.has_function like what we
already do in autotools build.
2018-06-09 09:40:51 +08:00
Philip Withnall
e22bffb522 Merge branch 'wip/oholy/trashing-locations2' into 'master'
Resubmit of reverted trash related changes and tests

See merge request GNOME/glib!83
2018-06-09 00:28:09 +00:00
Philip Withnall
e3280675f5 Merge branch 'wip/lantw/freebsd-kqueue-simple' into 'master'
FreeBSD kqueue file monitor fixes: the simple parts

See merge request GNOME/glib!76
2018-06-08 21:36:27 +00:00
Philip Withnall
d1e2ef56ea Merge branch 'meson-distcheck' into 'master'
Update list of meson files to distcheck

See merge request GNOME/glib!86
2018-06-08 20:50:01 +00:00
Xavier Claessens
cb10eacedf Update list of meson files to distcheck 2018-06-08 15:29:20 -04:00
Ting-Wei Lan
6f2b3503a5 tests: Set both environment variable and locale when running tests
Non-glibc gettext implementation seems to decide the language from
LC_MESSAGES environment variable instead of LC_MESSAGES locale, so
we should set both environment variable and locale when running tests
which need translation from specific languages.
2018-06-09 02:40:01 +08:00
Ting-Wei Lan
313a0fffe5 tests: Use de_DE.UTF-8 instead of de_DE in gsettings test
FreeBSD doesn't have a de_DE locale without encoding suffix.
2018-06-09 02:40:01 +08:00
Ondrej Holy
1cbb5dd95f glocalfile: Fix error code when trash not found
G_IO_ERROR_NOT_SUPPORTED is used as parameter for g_set_io_error(),
however, errno is expected instead and thus error code is set to 0,
which is wrong. Let's use ENOTSUP instead.
2018-06-08 14:15:18 +02:00
Ondrej Holy
15cdcd2e0b glocalfile: Check that parent device is the same when trashing
To be honest, I am not sure why, but in some special environments (e.g.
our CI integration) can happen, that file device number is different from
parent device number. Return "Unable to find or create trash directory for
%s" error from g_local_file_trash() in that case and also set
G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH appropriately.
2018-06-08 13:27:13 +02:00
Ondrej Holy
83ca61a421 glocalfile: Add test case for g_file_trash
g_local_file_trash has been changed to return G_IO_ERROR_NOT_SUPPORTED
for locations on system-internal mounts. Let's verify that.

https://gitlab.gnome.org/GNOME/glib/issues/251
2018-06-08 13:27:13 +02:00
Philip Withnall
c251c719b6 glib-compile-resources: Minor string improvements to --help output
Fix some capitalisation problems, and one missing space.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-06-08 11:43:44 +01:00
Philip Withnall
037f286713 glib-compile-resources: Clarify --help output for --sourcedir argument
Make the --help output more consistent with the man page, making it more
obvious that --sourcedir only applies to the files referenced in FILE,
not to the location of FILE itself.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1406
2018-06-08 11:42:52 +01:00
Ondrej Holy
13e751cab4 glocalfile: Update G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH logic
Change G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH logic to be consistent
with recent g_local_file_trash changes, i.e. set this to FALSE for
locations on system-internal mounts.

https://gitlab.gnome.org/GNOME/glib/issues/251
2018-06-08 11:24:23 +02:00
Ondrej Holy
d1eaf72c00 glocalfile: Allow trashing only for locations supported by trash:///
New bugs appears periodically in nautilus/gvfs/glib components that not
all trashed files are shown in trash:///. It used to be problem mostly
for "bind mounts" and btrfs subvolumes only. Currently, it is also
problem for nfs, cifs and other filesystems, which have been recently
added by commmit 0d69462f on the list of system internal filesystems.

This happens because the trash backend doesn't monitor files on system
internal mounts. Such behavior is not against the trash-spec, however,
we should be consistent within GNOME.

This behavior has the nice side-effect that it solves issues with hangs
on network filesystems: https://gitlab.gnome.org/GNOME/glib/issues/605,
because those are currently on the system internal filesystem list.

https://gitlab.gnome.org/GNOME/glib/issues/251
2018-06-08 11:24:20 +02:00
Philip Withnall
da3daf2803 Revert "Merge branch 'wip/oholy/trashing-locations' into 'master'"
This reverts merge request !49
2018-06-07 16:42:57 +00:00
Xavier Claessens
b04142a24f Merge branch 'fam' into 'master'
Meson: Build fam module

See merge request GNOME/glib!71
2018-06-07 15:18:38 +00:00
Ting-Wei Lan
c61f01f0ff build: Define MAJOR_IN_TYPES when major is defined in sys/types.h
Autoconf macro AC_HEADER_MAJOR doesn't define a macro in config.h when
major is defined in sys/types.h. This was not a problem because major
is assumed to be always available. However, commit aefffa3fbc
changes this assumption in order to fix build on systems without major,
which causes code using major to be disabled on systems putting major
in sys/types.h.

This commit defines a new macro MAJOR_IN_TYPES for both autotools and
meson builds to make major useful on these systems again.
2018-06-07 23:05:50 +08:00
Xavier Claessens
077e9f04c1 Meson: Build fam module
gio-querymodules-wrapper.py is copied from glib-networking. This python
wrapper script is needed because meson.build cannot check for DESTDIR
env variable itself, unlike Makefile.am. It is used to update
giomodule.cache file when installing GIO modules like fam.
2018-06-07 10:38:20 -04:00
Gaurav
cbde046018 Fix a warning reported by static analyzer tool 2018-06-07 13:45:55 +00:00
Xavier Claessens
11822c40bc Meson: Remove config.h.meson template
It became useless because glib_conf is not used anymore for generating
pkgconfig files. See issue #1313.
2018-06-07 09:28:03 -04:00
Philip Withnall
be43436435 Merge branch '1400-g_file_attribute_unix_is_mountpoint-is-false-for-root' into 'master'
Resolve "G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT is False for /"

Closes #1400

See merge request GNOME/glib!51
2018-06-07 09:22:07 +00:00
Will Thompson
0c5f084200
fileinfo: make UNIX_IS_MOUNTPOINT be TRUE for /
The previously implementation considered a file to be a mountpoint if
its parent is on a different device. / is its own parent, so by this
definition it is not a mountpoint.

But / is (generally) listed in fstab, and fstab(5) defines the
directories it contains to be mountpoints. This attribute should follow
that definition (and reasonable expectation): the root directory is a
mountpoint.

So, add a special-case for the case where the file's parent has the same
st_dev and st_ino as the file, which is true only at the root.

Test this attribute at / (only on POSIX), /proc (but only on Linux), and
at many files and directories created by the test suite (which cannot be
mountpoints).
2018-06-07 06:38:23 +01:00
Philip Withnall
6f5c8f6f33 Merge branch 'wip/lantw/freebsd-du-problems' into 'master'
tests: Don't fail when not using du from GNU coreutils

See merge request GNOME/glib!68
2018-06-07 01:16:07 +00:00
Ting-Wei Lan
f288898485 tests: Use g_idle_add to call g_main_loop_quit
Sometimes file monitor events may be slow to emit. Using g_idle_add
makes it less possible for events to be scheduled later than the main
loop quit, preventing test failure caused by missing events.

This fixes test failure on FreeBSD.
2018-06-07 00:38:07 +08:00
Ting-Wei Lan
41259ac173 kqueue: Only fallback to polling on /media and /run/media
The check in _ke_is_excluded, which causes GKqueueFileMonitor to
fallback to GPollFileMonitor when it returns TRUE, was made to prevent
file monitor from blocking unmount of removable drives on systems not
supporting O_EVTONLY flag in open. However, since g_mount_can_unmount
always returns TRUE on Unix-like platforms, the check always returns
TRUE on non-standard mount points, which is very likely to cause all
programs on the desktop to use the polling fallback if GNOME is
installed in a different prefix for development. This makes the desktop
sluggish and results in bad developer experience on *BSD.
2018-06-07 00:38:07 +08:00
Ting-Wei Lan
70e4ca0340 tests: Don't run file creation and deletion test on kqueue
Kqueue isn't good at detecting rapid file creation and deletion. It
tends to miss events because events returned by the kernel don't include
filename information. Since the size of struct kevent is fixed, it is
probably not possible to extend the API to include file names without
breaking ABI. Therefore, we disables the test here to avoid test failure
that is impossible to fix in a reliable way.
2018-06-07 00:38:07 +08:00
Ting-Wei Lan
bfbeb6f0f5 tests: Don't fail when not using du from GNU coreutils
The test 'file' uses non-standard '--bytes' option when running du,
which may cause error on non-GNU systems. To keep the test working,
we skips the du check as if we don't find a du command when du fails.
2018-06-07 00:37:28 +08:00
Ting-Wei Lan
12a7f27256 meson: Don't use -export-dynamic
-export-dynamic is a libtool flag. It is also supported by GCC as an
undocumented flag, but it is not supported by Clang. Since we don't use
libtool in meson, we should use -Wl,--export-dynamic instead.
2018-06-07 00:34:36 +08:00
Ting-Wei Lan
0388367356 kqueue: Make _ke_is_excluded static
It is not used in any other file.
2018-06-07 00:34:36 +08:00
Chun-wei Fan
4bb173b297 build: Remove leftovers of Visual Studio project stuff
There are more leftover preconfigured stuff that we ought to remove...
2018-06-06 23:54:13 +08:00
Chun-wei Fan
f658e94e65 build: Drop Visual Studio projects
In master, it is already possible to build GLib using Visual Studio
using Meson[1] for some time, so we should focus on maintaining only the
Meson build files for building GLib with Visual Studio.

[1]: There are caveats when building with Visual Studio 2008, namely
     that one needs to use the mt command to embed the manifests that
     are generated with the .exe/DLLs, for all builds, and that in the
     case where the compilation hangs on Visual Studio 2008 x64, as a
     workaround, should stop the build by terminating all cl.exe tasks
     and change the compiler optimization flag from /O2 (full speed) to
     /O1 (optimize for size), due to compiler optimization issues.
2018-06-06 23:54:13 +08:00
Philip Withnall
205059b9c0 Merge branch 'wip/oholy/trashing-locations' into 'master'
glocalfile: Allow trashing only for locations supported by trash:///

See merge request GNOME/glib!49
2018-06-06 10:58:22 +00:00
Ondrej Holy
f7e80f8d0c glocalfile: Add test case for g_file_trash
g_local_file_trash has been changed to return G_IO_ERROR_NOT_SUPPORTED
for locations on system-internal mounts. Let's verify that.

https://gitlab.gnome.org/GNOME/glib/issues/251
2018-06-06 12:18:30 +02:00
Gaurav
4ade09416b Fix potential Null pointer dereference.
if "match" is NULL, it is dereferenced in match_free() (L:457)
2018-06-05 14:01:47 +00:00
Ondrej Holy
6dfd0a00e7 glocalfile: Update G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH logic
Change G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH logic to be consistent
with recent g_local_file_trash changes, i.e. set this to FALSE for
locations on system-internal mounts.

https://gitlab.gnome.org/GNOME/glib/issues/251
2018-06-05 14:53:15 +02:00
Ondrej Holy
15a47afb0e glocalfile: Allow trashing only for locations supported by trash:///
New bugs appears periodically in nautilus/gvfs/glib components that not
all trashed files are shown in trash:///. It used to be problem mostly
for "bind mounts" and btrfs subvolumes only. Currently, it is also
problem for nfs, cifs and other filesystems, which have been recently
added by commmit 0d69462f on the list of system internal filesystems.

This happens because the trash backend doesn't monitor files on system
internal mounts. Such behavior is not against the trash-spec, however,
we should be consistent within GNOME.

This behavior has the nice side-effect that it solves issues with hangs
on network filesystems: https://gitlab.gnome.org/GNOME/glib/issues/605,
because those are currently on the system internal filesystem list.

https://gitlab.gnome.org/GNOME/glib/issues/251
2018-06-05 14:53:15 +02:00
Christoph Reiter
553df9dcaf Merge branch 'fix-gdbus-unix-addresses-test' into 'master'
Fix failing gdbus-unix-addresses test when G_MESSAGES_DEBUG is set

See merge request GNOME/glib!50
2018-06-01 15:31:25 +00:00
Xavier Claessens
f929d14826 Fix failing gdbus-unix-addresses test when G_MESSAGES_DEBUG is set
This test assumes the subprocess does not print anything else on stdout
other than the dbus address, otherwise g_test_trap_assert_stdout()
fails to match. But if the env running tests has G_MESSAGES_DEBUG=all
then it will also print "PATH=%s".
2018-06-01 10:23:12 -04:00
Gaurav
593eeff55e Fix a warning reported by static analyser tool:
Assignment of a signed value which has type 'time_t' to a variable of a bigger integer type 'guint64'
2018-05-31 08:25:31 +00:00
Christoph Reiter
a2aa91ae5d win32: Remove all remaining WinXP compat code
Remove all code which is no longer built with Windows 7+
2018-05-29 17:16:38 +02:00
Emmanuele Bassi
61ccf733cc Merge branch 'wip/rishi/issue-1073' into 'master'
Revert "Return folder as icon for directories"

See merge request GNOME/glib!36
2018-05-29 07:43:56 +00:00
Philip Withnall
c3846b33d7 Merge branch 'identifier-typo-fix' into 'master'
gio: Fix some typos in the documentation

See merge request GNOME/glib!31
2018-05-28 16:58:13 +00:00
Philip Withnall
6730309826 Merge branch 'wip/hadess/g-drive-identifier' into 'master'
gio: Add G_DRIVE_IDENTIFIER_KIND_UNIX_DEVICE

See merge request GNOME/glib!10
2018-05-28 16:31:42 +00:00
Bastien Nocera
75950d70c9 gio: Deprecate G_VOLUME_IDENTIFIER_KIND_HAL_UDI
HAL itself has long been deprecated.
2018-05-28 17:20:21 +02:00
Debarshi Ray
25af5ad1da Revert "Return folder as icon for directories"
This workaround is no longer necessary because it was fixed in
shared-mime-info three years ago:
https://bugs.freedesktop.org/show_bug.cgi?id=89150

This reverts commit 90025254fd.

https://gitlab.gnome.org/GNOME/glib/issues/1073
2018-05-28 17:19:59 +02:00
Bastien Nocera
4c84eac38e gio: Add G_DRIVE_IDENTIFIER_KIND_UNIX_DEVICE
It's a synonym of G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE.
It doesn't change anything except not feeling dirty from using a wrongly
prefixed constant for the object type.

See: #182
2018-05-28 17:13:30 +02:00