mirror of https://github.com/zrafa/xinu-avr.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
702 B
32 lines
702 B
/* rflclose.c - rflclose */ |
|
|
|
#include <xinu.h> |
|
|
|
/*------------------------------------------------------------------------ |
|
* rflclose - Close a remote file device |
|
*------------------------------------------------------------------------ |
|
*/ |
|
devcall rflclose ( |
|
struct dentry *devptr /* Entry in device switch table */ |
|
) |
|
{ |
|
struct rflcblk *rfptr; /* Pointer to control block */ |
|
|
|
/* Wait for exclusive access */ |
|
|
|
wait(Rf_data.rf_mutex); |
|
|
|
/* Verify remote file device is open */ |
|
|
|
rfptr = &rfltab[devptr->dvminor]; |
|
if (rfptr->rfstate == RF_FREE) { |
|
signal(Rf_data.rf_mutex); |
|
return SYSERR; |
|
} |
|
|
|
/* Mark device closed */ |
|
|
|
rfptr->rfstate = RF_FREE; |
|
signal(Rf_data.rf_mutex); |
|
return OK; |
|
}
|
|
|