1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

- Fixed the compilation problems I had introduced by mistake.

git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14849 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2005-03-02 14:47:10 +00:00
parent ac0cc97924
commit 593caccb38
2 changed files with 27 additions and 28 deletions

View File

@ -1,5 +1,5 @@
/* /*
* $Id: stat_lstat.c,v 1.6 2005-03-02 12:57:53 obarthel Exp $ * $Id: stat_lstat.c,v 1.7 2005-03-02 14:47:10 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@ -88,7 +88,7 @@ lstat_lock(const char *name,const int mode,int *link_length)
while(TRUE) while(TRUE)
{ {
/* Get a handle on the device, volume or assignment name in the path. */ /* Get a handle on the device, volume or assignment name in the path. */
dvp = GetDeviceProc(name,dvp); dvp = GetDeviceProc((STRPTR)name,dvp);
if(dvp == NULL) if(dvp == NULL)
goto out; goto out;
@ -138,7 +138,7 @@ lstat_lock(const char *name,const int mode,int *link_length)
} }
/* Now ask the file system to resolve the entire path. */ /* Now ask the file system to resolve the entire path. */
result = ReadLink(dvp->dvp_Port,dvp->dvp_Lock,name,name,name_size); result = ReadLink(dvp->dvp_Port,dvp->dvp_Lock,(STRPTR)name,(STRPTR)name,name_size);
if(result < 0) if(result < 0)
{ {
/* This will return either -1 (resolution error) or -2 /* This will return either -1 (resolution error) or -2
@ -148,7 +148,7 @@ lstat_lock(const char *name,const int mode,int *link_length)
} }
/* Remember the length of the link name. */ /* Remember the length of the link name. */
if(result > 0) if((*link_length) < result)
(*link_length) = result; (*link_length) = result;
/* We now have a new name to resolve. */ /* We now have a new name to resolve. */
@ -160,7 +160,7 @@ lstat_lock(const char *name,const int mode,int *link_length)
else else
{ {
/* Some other error; ask if the user wants to have another go at it. */ /* Some other error; ask if the user wants to have another go at it. */
if(ErrorReport(error,REPORT_LOCK,dvp->dvp_Lock,dp->dvp_Port) != 0) if(ErrorReport(error,REPORT_LOCK,dvp->dvp_Lock,dvp->dvp_Port) != 0)
break; break;
} }
@ -250,6 +250,7 @@ lstat(const char * path_name, struct stat * st)
st->st_blksize = 512; st->st_blksize = 512;
result = 0; result = 0;
goto out; goto out;
} }
} }
@ -272,7 +273,6 @@ lstat(const char * path_name, struct stat * st)
if(link_length > 0) if(link_length > 0)
{ {
struct DateStamp ds;
time_t mtime; time_t mtime;
/* Build a dummy stat for the link. */ /* Build a dummy stat for the link. */
@ -281,14 +281,10 @@ lstat(const char * path_name, struct stat * st)
memset(st,0,sizeof(*st)); memset(st,0,sizeof(*st));
PROFILE_OFF(); time(&mtime);
DateStamp(&ds);
PROFILE_ON();
mtime = __convert_datestamp_to_time(&ds);
st->st_mode = S_IFLNK | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; st->st_mode = S_IFLNK | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
st->st_dev = DeviceProc(path_name); st->st_dev = (ULONG)DeviceProc((STRPTR)path_name);
st->st_size = link_length; st->st_size = link_length;
st->st_mtime = mtime; st->st_mtime = mtime;
st->st_atime = mtime; st->st_atime = mtime;

View File

@ -1,5 +1,5 @@
/* /*
* $Id: utsname_uname.c,v 1.1 2005-03-02 12:57:53 obarthel Exp $ * $Id: utsname_uname.c,v 1.2 2005-03-02 14:47:10 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@ -62,7 +62,7 @@
#ifdef __amigaos4__ #ifdef __amigaos4__
#define ARCH "ppc" #define ARCH "ppc"
#else #else
#define ARCH "m68k" /* XXX: How should Coldfire accelerators be handled? */ #define ARCH "m68k" /* XXX: How should Coldfire accelerators be handled? */
#endif /* __amigaos4__ */ #endif /* __amigaos4__ */
/****************************************************************************/ /****************************************************************************/
@ -87,11 +87,15 @@ uname(struct utsname *info)
strlcpy(info->sysname,OSNAME,sizeof(info->sysname)); strlcpy(info->sysname,OSNAME,sizeof(info->sysname));
#if defined(SOCKET_SUPPORT) #if defined(SOCKET_SUPPORT)
__gethostname((STRPTR)info->nodename,sizeof(info->nodename)); {
#else __gethostname((STRPTR)info->nodename,sizeof(info->nodename));
strlcpy(info->nodename,"localhost",sizeof(info->nodename)); }
#endif /* SOCKET_SUPPORT */ #else
{
strlcpy(info->nodename,"localhost",sizeof(info->nodename));
}
#endif /* SOCKET_SUPPORT */
VersionBase = OpenLibrary("version.library",0L); VersionBase = OpenLibrary("version.library",0L);
if(VersionBase != NULL) if(VersionBase != NULL)
@ -109,16 +113,17 @@ uname(struct utsname *info)
snprintf(info->release,sizeof(info->release),"%d.%d",Version,Revision); snprintf(info->release,sizeof(info->release),"%d.%d",Version,Revision);
/* This is mostly a stab in the dark. Is there any "official" way of finding out the OS version? /*
* This is mostly a stab in the dark. Is there any "official" way of finding out the OS version?
* Also, this could be more detailed e.g. "3.9-BB2" instead of just "3.9". * Also, this could be more detailed e.g. "3.9-BB2" instead of just "3.9".
* For the curious: * For the curious:
* *
* V.R OS Version * V.R OS Version
* *
* 30.x 1.0 (Never released) * 30.x 1.0 (Never released)
* 31.x 1.1 (NTSC) * 31.x 1.1 (NTSC)
* 32.x 1.1 (PAL) * 32.x 1.1 (PAL)
* 33.x 1.2 * 33.x 1.2
* 34.x 1.3 * 34.x 1.3
* 35.x 1.3 (with A2024 support) * 35.x 1.3 (with A2024 support)
* 36.x 2.0-2.02 * 36.x 2.0-2.02
@ -126,24 +131,22 @@ uname(struct utsname *info)
* 38.x 2.1 * 38.x 2.1
* 39.x 3.0 * 39.x 3.0
* 40.x 3.1 * 40.x 3.1
* 43.x 3.2 (Never released)
* 44.2 3.5 * 44.2 3.5
* 44.4 3.5-BB1 * 44.4 3.5-BB1
* 44.5 3.5-BB2 * 44.5 3.5-BB2
* 45.1 3.9 * 45.1 3.9
* 45.2 3.9-BB1 * 45.2 3.9-BB1
* 45.3 3.9-BB2 * 45.3 3.9-BB2
*
*/ */
if (Version >= 46) if (46 <= Version && Version <= 52)
version_string = "4.0"; version_string = "4.0";
else if (Version == 45) else if (Version == 45)
version_string = "3.9"; version_string = "3.9";
else if (Version >= 44) else if (Version >= 44)
version_string = "3.5"; version_string = "3.5";
else if (Version >= 40) else if (Version >= 40)
version_string = 3.1"; version_string = "3.1";
else if (Version >= 39) else if (Version >= 39)
version_string = "3.0"; version_string = "3.0";
else else