summaryrefslogtreecommitdiffstats
path: root/perl-install/c/stuff.xs.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-03-11 01:11:06 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-03-11 01:11:06 +0000
commitf39f307ded336dddb9a4767b1128b82471446412 (patch)
tree1b32019b5547e9706346c48fb34f8dfa062af865 /perl-install/c/stuff.xs.pm
parent39b16a6249eb865a2319a8e3cb1e4270e6fec539 (diff)
downloaddrakx-f39f307ded336dddb9a4767b1128b82471446412.tar
drakx-f39f307ded336dddb9a4767b1128b82471446412.tar.gz
drakx-f39f307ded336dddb9a4767b1128b82471446412.tar.bz2
drakx-f39f307ded336dddb9a4767b1128b82471446412.tar.xz
drakx-f39f307ded336dddb9a4767b1128b82471446412.zip
no_comment
Diffstat (limited to 'perl-install/c/stuff.xs.pm')
-rw-r--r--perl-install/c/stuff.xs.pm18
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 '