ObjFW  Check-in [208285040f]

Overview
Comment:Fix a few places using msec instead of usec
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 208285040f66ffc8b8b4341f27561e84b62bb2c6c5816838d2168848cb4cd36c
User & Date: js on 2020-11-29 02:21:31
Other Links: manifest | tags
Context
2020-11-29
02:44
OFKernelEventObserver: Reorder #ifdefs check-in: d76213374e user: js tags: trunk
02:21
Fix a few places using msec instead of usec check-in: 208285040f user: js tags: trunk
00:59
of_bitset_*: Use CHAR_BIT instead of 8 check-in: b46492384a user: js tags: trunk
Changes

Modified src/OFFileURLHandler.m from [987947edfd] to [9e0a7e3741].

733
734
735
736
737
738
739
740
741
742
743
744
745

746
747
748
749
750
751
752
	    lastAccessDate.timeIntervalSince1970;
	of_time_interval_t modificationTime =
	    modificationDate.timeIntervalSince1970;
	struct timeval times[2] = {
		{
			.tv_sec = (time_t)lastAccessTime,
			.tv_usec =
			    (int)((lastAccessTime - times[0].tv_sec) * 1000)
		},
		{
			.tv_sec = (time_t)modificationTime,
			.tv_usec =
			    (int)((modificationTime - times[1].tv_sec) * 1000)

		},
	};

	if (utimes([path cStringWithEncoding: [OFLocale encoding]], times) != 0)
		@throw [OFSetItemAttributesFailedException
		    exceptionWithURL: URL
			  attributes: attributes







|



<
|
>







733
734
735
736
737
738
739
740
741
742
743

744
745
746
747
748
749
750
751
752
	    lastAccessDate.timeIntervalSince1970;
	of_time_interval_t modificationTime =
	    modificationDate.timeIntervalSince1970;
	struct timeval times[2] = {
		{
			.tv_sec = (time_t)lastAccessTime,
			.tv_usec =
			    (int)((lastAccessTime - times[0].tv_sec) * 1000000)
		},
		{
			.tv_sec = (time_t)modificationTime,

			.tv_usec = (int)((modificationTime - times[1].tv_sec) *
			    1000000)
		},
	};

	if (utimes([path cStringWithEncoding: [OFLocale encoding]], times) != 0)
		@throw [OFSetItemAttributesFailedException
		    exceptionWithURL: URL
			  attributes: attributes

Modified src/OFSelectKernelEventObserver.m from [22b01117bc] to [63c9f7d74b].

194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
	 * satisfy the required range, we just cast to int.
	 */
#ifndef OF_WINDOWS
	timeout.tv_sec = (time_t)timeInterval;
#else
	timeout.tv_sec = (long)timeInterval;
#endif
	timeout.tv_usec = (int)((timeInterval - timeout.tv_sec) * 1000);

#ifdef OF_AMIGAOS
	if ((cancelSignal = AllocSignal(-1)) == (ULONG)-1)
		@throw [OFObserveFailedException exceptionWithObserver: self
								 errNo: EAGAIN];

	execSignalMask = _execSignalMask | (1ul << cancelSignal);







|







194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
	 * satisfy the required range, we just cast to int.
	 */
#ifndef OF_WINDOWS
	timeout.tv_sec = (time_t)timeInterval;
#else
	timeout.tv_sec = (long)timeInterval;
#endif
	timeout.tv_usec = (int)((timeInterval - timeout.tv_sec) * 1000000);

#ifdef OF_AMIGAOS
	if ((cancelSignal = AllocSignal(-1)) == (ULONG)-1)
		@throw [OFObserveFailedException exceptionWithObserver: self
								 errNo: EAGAIN];

	execSignalMask = _execSignalMask | (1ul << cancelSignal);