Added headers for missing function prototypes.
This commit is contained in:
parent
6a0d455dd0
commit
37223e0cb9
|
@ -1,4 +1,5 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
void __eprintf(const char *format,...) /* for asserts */
|
||||
|
|
|
@ -1,37 +1,38 @@
|
|||
#include <proto/dos.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <proto/dos.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
int readlink(const char *path, char *buf, int bufsiz) {
|
||||
struct DevProc *dp = NULL;
|
||||
BPTR lock = NULL;
|
||||
int retval = -1;
|
||||
int readlink(const char *path, char *buf, int bufsiz)
|
||||
{
|
||||
struct DevProc *dp = NULL;
|
||||
BPTR lock = NULL;
|
||||
int retval = -1;
|
||||
|
||||
lock = Open(path, MODE_OLDFILE);
|
||||
if (lock == NULL) {
|
||||
errno = ENOENT;
|
||||
goto done;
|
||||
}
|
||||
lock = Open(path, MODE_OLDFILE);
|
||||
if (lock == NULL) {
|
||||
errno = ENOENT;
|
||||
goto done;
|
||||
}
|
||||
|
||||
dp = GetDeviceProc(path, NULL);
|
||||
if (dp == NULL) {
|
||||
errno = EINVAL;
|
||||
goto done;
|
||||
}
|
||||
dp = GetDeviceProc(path, NULL);
|
||||
if (dp == NULL) {
|
||||
errno = EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
||||
retval = ReadLink(dp->dvp_Port, lock, path, buf, bufsiz);
|
||||
if (retval == TRUE)
|
||||
retval = strlen(buf);
|
||||
else
|
||||
retval = -1;
|
||||
retval = ReadLink(dp->dvp_Port, lock, path, buf, bufsiz);
|
||||
if (retval == TRUE)
|
||||
retval = strlen(buf);
|
||||
else
|
||||
retval = -1;
|
||||
|
||||
done:
|
||||
if (dp != NULL)
|
||||
FreeDeviceProc(dp);
|
||||
|
||||
if (lock != NULL)
|
||||
UnLock(lock);
|
||||
return retval;
|
||||
if (dp != NULL)
|
||||
FreeDeviceProc(dp);
|
||||
|
||||
if (lock != NULL)
|
||||
UnLock(lock);
|
||||
return retval;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
|
Loading…
Reference in New Issue