summaryrefslogtreecommitdiff
path: root/modules/pammodutil/modutil_ioloop.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/pammodutil/modutil_ioloop.c')
-rw-r--r--modules/pammodutil/modutil_ioloop.c52
1 files changed, 0 insertions, 52 deletions
diff --git a/modules/pammodutil/modutil_ioloop.c b/modules/pammodutil/modutil_ioloop.c
deleted file mode 100644
index a852a7b8..00000000
--- a/modules/pammodutil/modutil_ioloop.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * $Id$
- *
- * These functions provides common methods for ensure a complete read or
- * write occurs. It handles EINTR and partial read/write returns.
- */
-
-#include <unistd.h>
-#include <errno.h>
-
-#include <security/pam_modules.h>
-#include "include/security/_pam_modutil.h"
-
-int _pammodutil_read(int fd, char *buffer, int count)
-{
- int block, offset = 0;
-
- while (count > 0) {
- block = read(fd, &buffer[offset], count);
-
- if (block < 0) {
- if (errno == EINTR) continue;
- return block;
- }
- if (block == 0) return offset;
-
- offset += block;
- count -= block;
- }
-
- return offset;
-}
-
-int _pammodutil_write(int fd, const char *buffer, int count)
-{
- int block, offset = 0;
-
- while (count > 0) {
- block = write(fd, &buffer[offset], count);
-
- if (block < 0) {
- if (errno == EINTR) continue;
- return block;
- }
- if (block == 0) return offset;
-
- offset += block;
- count -= block;
- }
-
- return offset;
-}