summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-05-25 13:33:34 +0200
committerChristoph Herzog <chris@theduke.at>2023-05-26 10:21:58 +0200
commitffba88fb5737f37202ea53e4dac593f096166765 (patch)
tree144293e3e4a08a36521ecc1a192fed9bba78dcbe
parentce63781c92655af04beaac0a209fdd674ccf58b4 (diff)
Some changes to have curl running with minimal sources changes
-rw-r--r--libc-bottom-half/cloudlibc/src/common/time.h4
-rw-r--r--libc-bottom-half/cloudlibc/src/libc/sys/socket/send.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/libc-bottom-half/cloudlibc/src/common/time.h b/libc-bottom-half/cloudlibc/src/common/time.h
index 08e2852..0fa56a3 100644
--- a/libc-bottom-half/cloudlibc/src/common/time.h
+++ b/libc-bottom-half/cloudlibc/src/common/time.h
@@ -36,9 +36,9 @@ static inline bool timespec_to_timestamp_clamp(
if (timespec->tv_nsec < 0 || timespec->tv_nsec >= NSEC_PER_SEC)
return false;
- if (timespec->tv_sec < 0) {
+ if (timespec->tv_sec <= 0) {
// Timestamps before the Epoch are not supported.
- *timestamp = 0;
+ *timestamp = 1; // means immediate
} else if (__builtin_mul_overflow(timespec->tv_sec, NSEC_PER_SEC, timestamp) ||
__builtin_add_overflow(*timestamp, timespec->tv_nsec, timestamp)) {
// Make sure our timestamp does not overflow.
diff --git a/libc-bottom-half/cloudlibc/src/libc/sys/socket/send.c b/libc-bottom-half/cloudlibc/src/libc/sys/socket/send.c
index 1f0c7da..cd06af1 100644
--- a/libc-bottom-half/cloudlibc/src/libc/sys/socket/send.c
+++ b/libc-bottom-half/cloudlibc/src/libc/sys/socket/send.c
@@ -9,8 +9,8 @@
#include <errno.h>
ssize_t send(int socket, const void *buffer, size_t length, int flags) {
- // This implementation does not support any flags.
- if (flags != 0) {
+ // This implementation does not support any flags, but we can ignore NOSIGNAL
+ if ((flags&~MSG_NOSIGNAL) != 0) {
errno = EOPNOTSUPP;
return -1;
}