mailing list of musl libc
 help / color / mirror / code / Atom feed
e2e98b998a06861b2db1abfdd46ff9ce752e42a6 blob 304 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
 
#include <unistd.h>
#include <stdio.h>

long gethostid()
{
	FILE *f;
	unsigned char hostid[4];
	long rv = 0;

	f = fopen("/etc/hostid", "reb");
	if (f) {
		if (fread(hostid, 1, 4, f) == 4) {
			rv = (hostid[3] << 24) | (hostid[2] << 16) | (hostid[1] << 8) | hostid[0];
		}
		fclose(f);
	}

	return rv;
}
debug log:

solving e2e98b99 ...
found e2e98b99 in https://inbox.vuxu.org/musl/20200803205529.2232-1-ericonr@disroot.org/
found 25bb35db in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 25bb35db862d297f92ff3931b1964373d48194d8	src/misc/gethostid.c

applying [1/1] https://inbox.vuxu.org/musl/20200803205529.2232-1-ericonr@disroot.org/
diff --git a/src/misc/gethostid.c b/src/misc/gethostid.c
index 25bb35db..e2e98b99 100644

Checking patch src/misc/gethostid.c...
Applied patch src/misc/gethostid.c cleanly.

index at:
100644 e2e98b998a06861b2db1abfdd46ff9ce752e42a6	src/misc/gethostid.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).