search for: set_loop

Displaying 4 results from an estimated 4 matches for "set_loop".

Did you mean: set_lock
2019 Nov 05
0
[klibc:master] losetup: Fix char signedness mismatches with <linux/loop.h>
...*device) if (loopinfo64.lo_encrypt_type || loopinfo64.lo_crypt_name[0]) { - char *e = loopinfo64.lo_crypt_name; + const char *e = (const char *)loopinfo64.lo_crypt_name; if (*e == 0 && loopinfo64.lo_encrypt_type == 1) e = "XOR"; @@ -258,14 +258,14 @@ int set_loop(const char *device, const char *file, unsigned long long offset, memset(&loopinfo64, 0, sizeof(loopinfo64)); - xstrncpy(loopinfo64.lo_file_name, file, LO_NAME_SIZE); + xstrncpy((char *)loopinfo64.lo_file_name, file, LO_NAME_SIZE); if (encryption && *encryption) { if (digits...
2010 Mar 14
0
[patches] klibc review unsorted patch queue
...} + if (read(pfd, pass+i, 1) != 1 || + pass[i] == '\n' || pass[i] == 0) + break; + } + + if (pass == NULL) + return ""; + + pass[i] = 0; + return pass; +} + +static int digits_only(const char *s) +{ + while (*s) + if (!isdigit(*s++)) + return 0; + return 1; +} + +int set_loop(const char *device, const char *file, unsigned long long offset, + const char *encryption, int pfd, int *loopro) { + struct loop_info64 loopinfo64; + int fd, ffd, mode, i; + char *pass; + + mode = (*loopro ? O_RDONLY : O_RDWR); + if ((ffd = open(file, mode)) < 0) { + if (!*loopro && er...
2011 Jul 05
0
[PATCH] losetup: use stdout and return 0 for -h
...9 +476,9 @@ int main(int argc, char **argv) res = show_loop(device); else { if (offset && sscanf(offset, "%llu", &off) != 1) - usage(); + usage(stderr); if (passfd && sscanf(passfd, "%d", &pfd) != 1) - usage(); + usage(stderr); res = set_loop(device, file, off, encryption, pfd, &ro); } return res; -- 1.7.5.4
2019 Nov 05
0
[klibc:master] losetup: Delete fallbacks to LOOP_{GET, SET}_STATUS
...ype) - printf(", encryption type %d\n", - loopinfo.lo_encrypt_type); - - printf("\n"); - close (fd); - return 0; - } - errsv = errno; fprintf(stderr, "loop: can't get info on device %s: %s\n", device, strerror (errsv)); @@ -296,21 +248,8 @@ int set_loop(const char *device, const char *file, unsigned long long offset, close (ffd); i = ioctl(fd, LOOP_SET_STATUS64, &loopinfo64); - if (i) { - struct loop_info loopinfo; - int errsv = errno; - - i = loop_info64_to_old(&loopinfo64, &loopinfo); - if (i) { - errno = errsv; - perro...