Commit Graph

216 Commits

Author SHA1 Message Date
Max Kellermann ce093be12c system/Error: add FormatFileNotFound() 2019-12-04 12:33:38 +01:00
Max Kellermann 2c276770f0 util/PrintException, ...: update copyright 2019-12-04 12:33:36 +01:00
Max Kellermann 75a592f629 system/Error: move code to IsErrno() 2019-12-04 12:33:33 +01:00
Max Kellermann a478af6759 util/PrintException, ...: update copyright 2019-08-19 19:11:59 +02:00
Max Kellermann 4c2434788f system/FileDescriptor: add method IsRegularFile() 2019-08-19 19:11:53 +02:00
Max Kellermann b94de51ac4 system/Error: move code to IsErrno() 2019-07-12 17:11:14 +02:00
Max Kellermann d663f81420 include cleanups (powered by iwyu) 2019-07-05 09:59:58 +02:00
Max Kellermann a139279575 Copyright year 2019 2019-06-17 11:17:30 +02:00
Max Kellermann e0d5d88104 Log: make LogLevel the first parameter
Prepare for templated functions.
2019-05-23 12:17:59 +02:00
Max Kellermann 5641c4baa6 system/Clock, fs/FileInfo: move FILETIME specific code to time/FileTime.hxx 2019-05-08 16:02:13 +02:00
Max Kellermann 96f889276f system/Clock: GetProcessUptimeS() returns std::chrono::duration 2019-05-08 15:58:01 +02:00
Max Kellermann c176d94598 system/ByteOrder: move to util/ 2019-03-08 10:21:10 +01:00
Max Kellermann 38f0c16904 system/UniqueFileDescriptor: add CreatePipeNonBlock() 2019-02-27 23:30:56 +01:00
Max Kellermann da4bb4c298 fs/io/OutputStream: update include guard 2019-02-19 12:39:29 +01:00
Max Kellermann 56bded07b1 system/UniqueFileDescriptor: import std::swap 2019-02-19 12:36:54 +01:00
Max Kellermann db144a43ad system/Open: add OpenWriteOnly(), OpenDirectory() 2019-02-19 12:16:41 +01:00
Max Kellermann 5965f62b56 system/EpollFD: include cleanup 2019-02-19 11:51:52 +01:00
HyShai 18c042d4cf
remove non-block call
This is similar to b177bffa6a, in that it fixes the Windows issue of connecting to the open socket. Also, the listen_socket is set to AcceptNonBlock after the connection anyways.
2018-12-18 15:23:40 -05:00
Max Kellermann ce49d99c2f check.h: remove obsolete header
Since we switched from autotools to Meson in commit
94592c1406, we don't need to include
`config.h` early to properly enable large file support.  Meson passes
the required macros on the compiler command line instead of defining
them in `config.h`.

This means we can include `config.h` at any time, whenever we want to
check its macros, and there are no ordering constraints.
2018-11-19 16:33:49 +01:00
Max Kellermann bba22c9c8c system/FileDescriptor: check `__linux__` instead of `__linux`
`__linux` is the deprecated non-standard macros which appears to be
not present at all on PowerPC.

Closes #398
2018-11-02 16:50:38 +01:00
Max Kellermann f5c9071494 *: copyright year 2018 2018-10-31 17:54:59 +01:00
Max Kellermann 94592c1406 build with Meson instead of autotools
So long, autotools!  This is my last MPD related project to migrate
away from it.  It has its strengths, but also very obvious weaknesses
and weirdnesses.  Today, many of its quirks are not needed anymore,
and are cumbersome and slow.  Now welcome our new Meson overlords!
2018-10-14 23:41:38 +02:00
Max Kellermann fe2f7a3e5a configure.ac: add automake conditional "LINUX" 2018-08-22 16:09:40 +02:00
Max Kellermann 98eed1f5ab system/EpollFD: use class UniqueFileDescriptor 2018-08-22 16:09:40 +02:00
Max Kellermann 5d0a463f09 system/{Epoll,Event,Signal}FD: relicense to BSD-2 2018-08-22 15:40:45 +02:00
Max Kellermann dd461400fb system/EPollFD: rename to EpollFD 2018-08-22 15:40:45 +02:00
Max Kellermann b1390ec27f system/UniqueFileDescriptor: make the "int" constructor public 2018-08-22 15:40:45 +02:00
Max Kellermann d092a88a93 system/Open: new UniqueFileDescriptor constructing library 2018-08-21 18:27:39 +02:00
Max Kellermann d036e20826 system/FileDescriptor: add openat() wrapper 2018-08-21 18:15:37 +02:00
Max Kellermann 4f2163e76c system/FileDescriptor: include cleanup 2018-08-20 17:25:42 +02:00
Max Kellermann eef66dee04 system/FileDescriptor: pass FileDescriptor to CheckDuplicate() 2018-08-20 17:23:14 +02:00
Max Kellermann 7ad440ca1c net/SocketDescriptor: make eventfd() and signalfd() mandatory on Linux 2018-08-20 17:16:07 +02:00
Max Kellermann 13b3e9e7b3 system/FileDescriptor: make inotify_init1() mandatory on Linux 2018-08-20 17:12:50 +02:00
Max Kellermann 8106929d60 system/FileDescriptor: add pipe2() wrapper 2018-08-20 17:05:29 +02:00
Max Kellermann 795baed3f5 system/FileDescriptor: make pipe2() mandatory on Linux 2018-08-20 17:04:43 +02:00
Max Kellermann 5487d40be9 system/FileDescriptor: add operator!= 2018-08-20 16:49:14 +02:00
Max Kellermann 5e512763d3 system/UniqueFileDescriptor: make the base class public 2018-08-20 16:38:27 +02:00
Max Kellermann a65d02d3ae system/FileDescriptor: add "noexcept" 2018-08-20 16:34:47 +02:00
Max Kellermann ec54754e22 Compiler.h: move to util/ 2018-08-20 16:19:17 +02:00
Max Kellermann b5c569cd30 system/FileDescriptor: add IsPipe(), IsSocket() 2018-08-20 16:05:03 +02:00
Max Kellermann 1ba35e1fd4 release v0.20.21
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAlt3CwMQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEiQcD/0S7NzE9nLsuTJJB9ElzOW17XiKkLKuDErQ
 P1r46APwa0agqfHFTUM5a+ifMCFQ4QTh0p+MiImYniBKmTnuKYBxZJFgHYojrPOS
 jxJbPJI6R7vLfo07kIem1jw/3YjqF4BDJyn9FYLBLgWz3IiFC/H4XH4XYxoQhTYL
 Xv0aGMCnil6gD2ENvx4by3tqsM9l5ktvPwR6bktRw4ImhgT5zHShpuPYZekas1ic
 +A1oCXFO4UrlZQ0sHdcG7Up8NOEJvAiNR5+BCnb9aR8l6M2Mzu2u715zSSWvTBI+
 SCa8lE/gkndJC2Q3BmPRp+OcWU/uwVIkWdJdCF8DgN5vmk3cLRJ/SpHGkR1iYSvF
 MUW8QF0tc2Xctv0NHYXlDj6wVVJ+OWNUcNy6SWHAT7o5S0ppB+2nesAfTVqqGK/Z
 yRmcW5CvYNH8dfN7WBkLehN57dpI6O1YkfF30xCPcT+fu4oBYv7owU4MqFVcJN2r
 FEbTZCfRFGjF7Kmb6aF+mFMhTnqYNEZjFS0SljLJWjlimLaSfgTXdEv23IpxIMnV
 i+CEy7B2RseR31tmCekyWxdLnNJPYC4Zqwer8dd7yrY/exEM/6x9JQDUbCaGccar
 NlwmCj6uDKXxU3tkb9Mk77oX51dFL58BtpoQw/DfXRWSX+UsAxFioyAbJ9juJUrM
 JO9WMABo0Q==
 =2zvn
 -----END PGP SIGNATURE-----

Merge tag 'v0.20.21'

release v0.20.21
2018-08-17 20:02:27 +02:00
Max Kellermann 98efb4f6d5 android: raise minSdkVersion to 21
The number of MPD installs on Android < 5.0 is negligible, and that
API version introduces lots of useful features for MPD.
2018-08-17 19:01:37 +02:00
Max Kellermann 4218f56f6c system/SignalFD: add "noexcept" 2018-08-06 11:58:37 +02:00
Max Kellermann dd18fe34a7 system/SignalFD: throw exception on error 2018-08-06 11:58:29 +02:00
Max Kellermann 5b09504a71 system/Event{FD,Pipe}: add "noexcept" 2018-08-06 11:57:40 +02:00
Max Kellermann 0c1a001622 system/Event{FD,Pipe}: throw exception on error 2018-08-06 11:49:38 +02:00
Max Kellermann d4ce9c0df2 system/FileDescriptor: no-op implementation of *CloseOnExec() on Windows
Fixes the NFS client build, closes #305.
2018-07-13 18:16:39 +02:00
Max Kellermann 13ac74e0a2 system/EPollFD: update API documentation 2018-01-29 21:49:27 +01:00
Max Kellermann c2f23d92dc system/EPollFD: add "noexcept" 2018-01-29 21:48:39 +01:00
Max Kellermann 6246d36fe6 Merge branch 'v0.20.x' 2017-12-16 20:56:06 +01:00
Max Kellermann dfaf08743c *: check defined(_WIN32) instead of defined(WIN32)
Only _WIN32 is defined by the compiler, and WIN32 is not standardized
and may be missing.

Closes #169
2017-12-12 10:22:20 +01:00
Max Kellermann d9552d8a6d android/build.py: support NDK r16 2017-12-12 10:01:47 +01:00
Max Kellermann b177bffa6a system/EventPipe: fix WSAEINPROGRESS on Windows
Apparently, connecting a socket to a loopback address can block on
Windows, and a non-blocking socket will return WSAEINPROGRESS.  This
broken PoorSocketPair() in commit 2119e4fd3e, which made the socket
non-blocking right from the start.  This fix postpones the
ioctlsocket(FIONBIO) call until after the connect().

Closes #134
2017-10-24 20:09:11 +02:00
Max Kellermann a6e62479be system/Error: include cleanup 2017-09-13 17:49:37 +02:00
Max Kellermann 6c825064ea system/Error: add more "noexcept" 2017-09-13 17:48:13 +02:00
Max Kellermann 13d02968bd system/FileDescriptor: Close() should not be called on undefined object
It does not do much harm - but it causes an unnecessary (failing)
system call.
2017-09-13 17:43:13 +02:00
Max Kellermann e576556149 system/UniqueFileDescriptor: remove duplicate "using" statements 2017-09-13 17:41:15 +02:00
Max Kellermann 66e74900df system/UniqueFileDescriptor: expose CheckDuplicate() 2017-09-13 17:40:33 +02:00
Max Kellermann aadc735d71 system/FileDescriptor: mention class UniqueFileDescriptor in API documentation 2017-09-13 17:39:29 +02:00
Max Kellermann a13897cf6f system/FileDescriptor: add CheckDuplicate() 2017-09-13 17:37:28 +02:00
Max Kellermann b188ae0e5c system/FileDescriptor: use _WIN32 instead of WIN32 2017-09-13 17:36:48 +02:00
Ryan Walklin 318f80d113 Fix EventPipe file descriptors 2017-08-17 12:21:01 +10:00
Max Kellermann b57a272f67 system/EPollFD: throw exception instead of raising fatal error 2017-08-11 09:39:47 +02:00
Max Kellermann 33b4114534 system/fd_util: remove unused library 2017-08-11 09:20:15 +02:00
Max Kellermann 7a4457402f system/EventPipe: use FileDescriptor::CreatePipeNonBlock() 2017-08-11 09:19:00 +02:00
Max Kellermann 9056dcaf7d system/FileDescriptor: add method CreatePipeNonBlock() 2017-08-11 09:15:22 +02:00
Max Kellermann 2119e4fd3e system/EventPipe: use class UniqueSocketDescriptor in PoorSocketPair() 2017-08-11 09:09:04 +02:00
Max Kellermann bcd5190f1d system/EventPipe: throw exception instead of raising fatal error 2017-08-11 09:09:04 +02:00
Max Kellermann d705a92e43 net/IPv4Address: new class 2017-08-11 09:09:04 +02:00
Max Kellermann 699f41e114 system/EventPipe: use AtScopeExit() in PoorSocketPair() 2017-08-11 08:30:37 +02:00
Max Kellermann 7484bc31b4 system/FileDescriptor: implement CreatePipe() on Windows 2017-08-11 08:15:47 +02:00
Max Kellermann 5a495cc165 system/fd_util: remove unused function close_socket() 2017-08-10 19:47:57 +02:00
Max Kellermann 9ff4717738 system/fd_util: remove unused function accept_cloexec_nonblock() 2017-08-10 19:47:40 +02:00
Max Kellermann 0c1740982d system/fd_util: remove unused function open_cloexec() 2017-08-10 19:46:23 +02:00
Max Kellermann eb0ff32efb system/FileDescriptor: add Open() overload with wchar_t path 2017-08-10 19:34:52 +02:00
Max Kellermann 0800d9427c system/fd_util: remove unused function socket_cloexec_nonblock() 2017-08-10 17:40:14 +02:00
Max Kellermann fb0dbce15b system/EventFD: use class UniqueFileDescriptor 2017-08-10 12:14:56 +02:00
Max Kellermann 8333551331 system/SignalFD: use class UniqueFileDescriptor 2017-08-10 12:13:41 +02:00
Max Kellermann 292d794806 system/UniqueFileDescriptor: new auto-closing FileDescriptor wrapper 2017-08-10 12:01:17 +02:00
Max Kellermann 91ce76af9d system/FileDescriptor: add methods EnableCloseOnExec(), DisableCloseOnExec() 2017-08-10 11:54:26 +02:00
Max Kellermann 33bd9e80bb system/FileDescriptor: add method IsReadyForWriting() 2017-08-10 11:53:43 +02:00
Max Kellermann d310f3e9b7 system/FileDescriptor: add method IsValid() 2017-08-10 11:52:22 +02:00
Max Kellermann 8c832f4c50 system/FileDescriptor: use std::exchange() 2017-08-10 09:55:11 +02:00
Max Kellermann 0a379fc514 system/ByteOrder: fix byte order detection on FreeBSD/aarch64
Patch from
 https://svnweb.freebsd.org/ports/head/audio/musicpd/files/patch-src_system_ByteOrder.hxx?revision=441921&view=co
(with a tiny modification)

Closes #59
2017-05-29 20:37:14 +02:00
Max Kellermann 71f0ed8b74 *: add "noexcept" to many, many function prototypes
This eliminates some overhead, because the compiler doesn't need to
consider these functions throwing.
2017-05-08 14:44:49 +02:00
Max Kellermann 6eea56861b AUTHORS, ...: update my email address 2017-01-17 11:54:55 +01:00
Max Kellermann 5900253b85 update copyright year 2017-01-03 20:48:59 +01:00
Max Kellermann 837134daef system/Clock: remove obsolete MonotonicClock*() functions
We're using std::chrono::steady_clock now.  No need to duplicate code.
2016-12-28 22:24:09 +01:00
Max Kellermann 4011899846 system/PeriodClock: use std::chrono::steady_clock 2016-12-28 22:23:45 +01:00
Max Kellermann e786207cc2 system/PeriodClock: indent with tabs 2016-12-28 01:18:42 +01:00
Max Kellermann c6e1ca1c22 system/Error: use std::generic_category() for errno on Windows
It's wrong to use std::system_category() for both GetLastError() and
errno on Windows.  Apparently, everybody uses std::generic_category()
for errno values, which appears to be a safe choice.

Some discussion on this confusing topic can be found here:

 https://stackoverflow.com/questions/28746372/system-error-categories-and-standard-system-error-codes
2016-12-04 20:07:11 +01:00
Max Kellermann 30dc473697 system/Error: allow using errno functions on Windows
The Windows standard library emulates part of POSIX, which includes
errno.
2016-12-04 20:07:09 +01:00
Max Kellermann 14885f25b4 system/FatalError: remove the obsolete class Error overloads 2016-11-10 12:55:08 +01:00
Max Kellermann fc7d3f64c0 input/Plugin: migrate open() from class Error to C++ exceptions 2016-09-09 18:15:01 +02:00
Max Kellermann d0dae177cf release v0.19.19
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJXvAb+AAoJECNuiljG20USLukP/1dWwG4U3eQllGtwmKYEuGT8
 x8bFImW3zziQgzzQNos8ZyB/7Q9wFDwl90q2Shyg778sk8WgBLVdn1hLhDRyodkg
 iTAbnuBeX0GoQO2vZ62jY/xtsSMwCguNMbJe5Yybq+uZ2EYLQO8NWsvy/qZzZRB6
 9s78IfQodN/vbKg8cJDPP1ZFvlhC+RfrOJbhwkAhh3D0xkpYjumW636ewcpD5Crk
 T+OT035konZEcH2hOy89tleFifo+/nosiJQXL5/RdfIVAy+rWj9HbKMT9Wlb2EO0
 iqvbjfC8rAt4a15Y8l/C42m1xhLFtRvI7O5I5wH8zqwpgRfCuG21Kw49zWFQ9md/
 tX2urKZC6QsvxfHx4J6ot+SFQJB/VZ1fufG1ZBTHVNp7eJ++mWE5pR79EbCLurlj
 x7cN1ZM7wsQfkw8MOsKr+sJqIGkU9sZSHHh3PhEkI83fEssYaAOGtkPuTqU0w/37
 wHV2laFD58SOagVPbQlhIdK6MnkiTR8RvV9j6ERywLnFNMBMiI9j7ij7zoDMKjSU
 E60JzIR4xUPWtQg91BwM5sJdqZw7xybgNBn0rMt+6AoA0CQseAnPRxA9gstrWR1/
 FYRPUzrf9brpvXEsT8R2tXcjNLNYgKzT3GxHEQj1k2MJiVe+1SztiYIi77JPLJfn
 MevaiCy/Ho3ZeQKygxVq
 =GsV+
 -----END PGP SIGNATURE-----

Merge tag 'v0.19.19'

release v0.19.19
2016-08-23 10:27:39 +02:00
Thomas Klausner de0752fd56 system/ByteOrder: gssupport non-x86 NetBSD 2016-08-23 10:15:54 +02:00
Max Kellermann a61f153df7 system/Error: add missing include 2016-07-02 13:59:47 +02:00
Max Kellermann 1d67aa7bf2 update copyright year to 2016 2016-02-26 17:54:05 +01:00
Max Kellermann 8e0e4d7c04 system/FileDescriptor: add method Skip() 2016-02-19 18:18:12 +01:00
Max Kellermann 08754e6ce7 system/Error: add IsAccessDenied() 2015-12-29 12:56:26 +01:00