Changeset 1946
- Timestamp:
- May 2, 2005, 4:56:25 AM (20 years ago)
- Location:
- trunk/src/emx
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/include/InnoTekLIBC/backend.h
-
Property cvs2svn:cvs-rev
changed from
1.20
to1.21
r1945 r1946 229 229 * @returns Negative error code (errno.h) on failure. 230 230 * @param pszPath Path to the new current directory of the process. 231 */ 232 int __libc_Back_fsDirCurrentSet(const char *pszPath); 231 * @param fDrive Force a change of the current drive too. 232 */ 233 int __libc_Back_fsDirCurrentSet(const char *pszPath, int fDrive); 233 234 234 235 /** -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/stdlib.h
-
Property cvs2svn:cvs-rev
changed from
1.31
to1.32
r1945 r1946 292 292 #ifdef __BSD_VISIBLE 293 293 char *_getcwdux(char *, size_t); 294 /** @todo: int _chdirux(char *); */295 294 char *_realrealpath(const char *, char *, size_t); 296 295 #endif … … 421 420 long double _atofl (__const__ char *); 422 421 int _chdir2 (__const__ char *); 422 int _chdir_os2 (const char *); 423 423 int _chdrive (int); 424 424 int _core (int); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/chdir.c
-
Property cvs2svn:cvs-rev
changed from
1.6
to1.7
r1945 r1946 2 2 /** @file 3 3 * 4 * chdir.4 * LIBC - chdir. 5 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird@innotek.de>6 * Copyright (c) 2004-2005 knut st. osmundsen <bird@innotek.de> 7 7 * 8 8 * … … 36 36 #include <InnoTekLIBC/logstrict.h> 37 37 38 38 39 /** 39 * Changes the current directory. 40 * Changes the current directory and drive. 41 * 42 * Use _chdir_os2 for a VAC/MSC compatible chdir. 40 43 * 41 44 * @returns 0 on success. … … 46 49 { 47 50 LIBCLOG_ENTER("path=%p:{%s}\n", (void *)path, path); 48 int rc = __libc_Back_fsDirCurrentSet(path );51 int rc = __libc_Back_fsDirCurrentSet(path, 1); 49 52 if (!rc) 50 53 LIBCLOG_RETURN_INT(0); … … 52 55 LIBCLOG_RETURN_INT(-1); 53 56 } 57 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/chdir2.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r1945 r1946 3 3 #include "libc-alias.h" 4 4 #include <stdlib.h> 5 #include <string.h>6 #include <emx/io.h>7 #include <emx/syscalls.h>8 #include <InnoTekLIBC/backend.h>9 5 10 6 int _chdir2 (const char *name) 11 7 { 12 char old_drive, new_drive; 13 14 old_drive = _getdrive (); 15 new_drive = _fngetdrive (name); 16 if (new_drive != 0) 17 { 18 if (_chdrive (new_drive) != 0) 19 return -1; 20 if (name[2] == 0) /* Change drive only */ 21 return 0; 22 } 23 int rc = __libc_Back_fsDirCurrentSet (name); 24 if (rc == 0) 25 return 0; 26 else 27 { 28 _chdrive (old_drive); 29 errno = -rc; 30 return -1; 31 } 8 return chdir(name); 32 9 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsDirCurrentSet.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r1945 r1946 44 44 * @returns Negative error code (errno.h) on failure. 45 45 * @param pszPath Path to the new current directory of the process. 46 * @param fDrive Force a change of the current drive too. 46 47 */ 47 int __libc_Back_fsDirCurrentSet(const char *pszPath )48 int __libc_Back_fsDirCurrentSet(const char *pszPath, int fDrive) 48 49 { 49 LIBCLOG_ENTER("pszPath=%p:{%s} \n", (void *)pszPath, pszPath);50 LIBCLOG_ENTER("pszPath=%p:{%s} fDrive=%d\n", (void *)pszPath, pszPath, fDrive); 50 51 FS_VAR(); 51 52 … … 69 70 * 70 71 * If we change into or out of the unix root, we must make sure the 71 * default disk is changed too. This means that we keep the OS/2 72 * semantics of chdir() when not in the unix comparement, with the 73 * obvious exception of root relative paths. 72 * default disk is changed too. We'll only do unix chdir behaviour 73 * when in the unix compartement or when fDrive is set. 74 74 */ 75 75 FS_SAVE_LOAD(); … … 78 78 if (!rc) 79 79 { 80 if ( __libc_gcchUnixRoot)80 if (fDrive || __libc_gcchUnixRoot) 81 81 { 82 if (f InUnixTree != __libc_gfInUnixTree)82 if (fDrive || fInUnixTree != __libc_gfInUnixTree) 83 83 { 84 84 ULONG ulDrive = szNativePath[0] - (szNativePath[0] >= 'A' && szNativePath[0] <= 'Z' ? 'A' - 1 : 'a' -1); … … 86 86 LIBC_ASSERTM(!rc, "DosSetDefaultDisk(%ld) -> %d. unix drive is %c\n", ulDrive, rc, szNativePath[0]); 87 87 rc = 0; /* ignore this kind of errors. */ 88 __libc_gfInUnixTree = fInUnixTree; 88 89 } 89 __libc_gfInUnixTree = fInUnixTree;90 90 } 91 91 } -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.