diff options
Diffstat (limited to 'perl-install/c')
-rw-r--r-- | perl-install/c/stuff.xs.pm | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/perl-install/c/stuff.xs.pm b/perl-install/c/stuff.xs.pm index cdaa2d292..d8395dc66 100644 --- a/perl-install/c/stuff.xs.pm +++ b/perl-install/c/stuff.xs.pm @@ -255,7 +255,7 @@ set_loop(dev_fd, file) if (file_fd < 0) return; - memset(&loopinfo, 0, sizeof (loopinfo)); + memset(&loopinfo, 0, sizeof(loopinfo)); strncpy(loopinfo.lo_name, file, LO_NAME_SIZE); loopinfo.lo_name[LO_NAME_SIZE - 1] = 0; @@ -269,6 +269,22 @@ set_loop(dev_fd, file) } OUTPUT: RETVAL + +int +del_loop(device) + char *device + CODE: + RETVAL = 0; +{ + int fd; + if ((fd = open(device, O_RDONLY)) < 0) return; + if (ioctl(fd, LOOP_CLR_FD, 0) < 0) return; + close(fd); + RETVAL = 1; +} + OUTPUT: + RETVAL + '; $ENV{C_RPM} and print ' |