+Wed Aug 16 02:45:19 1995 Chris Provenzano <proven@mit.edu>
+
+ * lock_file.c (krb5_lock_file()), unlck_file.c (krb5_unlock_file()):
+ Pass the fd in instead of converting it from FILE *.
+
Fri Aug 4 22:51:15 1995 Tom Yu <tlyu@dragons-lair.MIT.EDU>
* kuserok.c (krb5_kuserok): Add parens to shut up gcc -Wall
/*ARGSUSED*/
krb5_error_code
-krb5_lock_file(context, filep, pathname, mode)
+krb5_lock_file(context, fd, mode)
krb5_context context;
- FILE *filep;
- char *pathname;
+ int fd;
int mode;
{
#ifdef POSIX_FILE_LOCKS
lock_arg.l_whence = 0;
lock_arg.l_start = 0;
lock_arg.l_len = 0;
- if (fcntl(fileno(filep), lock_cmd, &lock_arg) == -1) {
+ if (fcntl(fd, lock_cmd, &lock_arg) == -1) {
if (errno == EACCES || errno == EAGAIN) /* see POSIX/IEEE 1003.1-1988,
6.5.2.4 */
return(EAGAIN);
return(errno);
}
#else
- if (flock(fileno(filep), lock_flag) == -1)
+ if (flock(fd, lock_flag) == -1)
return(errno);
#endif
return 0;
#else /* MSDOS or Macintosh */
krb5_error_code
-krb5_lock_file(context, filep, pathname, mode)
+krb5_lock_file(context, fd, mode)
krb5_context context;
- FILE *filep;
- char *pathname;
+ int fd;
int mode;
{
return 0;
#include <stdio.h>
krb5_error_code
-krb5_unlock_file(context, filep, pathname)
+krb5_unlock_file(context, fd)
krb5_context context;
- FILE *filep;
- char *pathname;
+ int fd;
{
- return krb5_lock_file(context, filep, pathname, KRB5_LOCKMODE_UNLOCK);
+ return krb5_lock_file(context, fd, KRB5_LOCKMODE_UNLOCK);
}