mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-21 17:11:58 +00:00
Fixup c utilities and add start_root
The diskless will use start_root to boot the 'main' OS as a container.
This commit is contained in:
parent
93c21d4148
commit
e0c59cc341
@ -1,6 +1,6 @@
|
||||
CC := gcc
|
||||
CFLAGS := -Os
|
||||
TARGETS := copernicus autocons
|
||||
TARGETS := copernicus autocons start_root
|
||||
|
||||
all: $(TARGETS) clortho
|
||||
|
||||
|
@ -95,7 +95,7 @@ int main(int argc, char* argv[]) {
|
||||
timeout.tv_usec = 500000;
|
||||
FD_ZERO(&set);
|
||||
FD_SET(ttyf, &set);
|
||||
write(ttyf, "\0337\033[999;999H\033[6n\0338", 18);
|
||||
if (write(ttyf, "\0337\033[999;999H\033[6n\0338", 18) < 0) {};
|
||||
while (select(ttyf + 1, &set, NULL, NULL, &timeout) > 0) {
|
||||
if ((tmpi = read(ttyf, buff + bufflen, 127 - bufflen)) < 0) {
|
||||
if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
||||
|
@ -116,7 +116,7 @@ int main(int argc, char* argv[]) {
|
||||
currtype = buffer[0];
|
||||
if (currtype & 0b10000000) {
|
||||
currlen = buffer[1] << 8;
|
||||
read(sock, buffer, 1);
|
||||
while (read(sock, buffer, 1) < 0) {};
|
||||
currlen |= buffer[0];
|
||||
} else {
|
||||
currlen = buffer[1];
|
||||
@ -131,7 +131,7 @@ int main(int argc, char* argv[]) {
|
||||
buffer[currlen] = 0;
|
||||
}
|
||||
if (currtype == 2) {
|
||||
dprintf(sock, "\x03%c", currlen);
|
||||
dprintf(sock, "\x03%zu", currlen);
|
||||
ret = write(sock, buffer, currlen);
|
||||
slen = strlen(cryptedpass) & 0xff;
|
||||
dprintf(sock, "\x04%c%s", slen, cryptedpass);
|
||||
|
Loading…
Reference in New Issue
Block a user