mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Added separate main program for the Mac: macmain.c
stdwinmodule.c: wsetfont can now return an error Makefile: add CL_USE and CL_LIB*S; config.c: move CL part around New things in imgfile; also in Makefile. longobject.c: fix comparison of negative long ints... [REAL BUG!] marshal.c: add dumps() and loads() to read/write strings timemodule.c: make sure there's always a floatsleep() posixmodule.c: rationalize struct returned by times() Makefile: add test target, disable imgfile by default thread.c: Improved coexistance with dl module (sjoerd) stdwinmodule.c: Change include stdwin.h if macintosh rotormodule.c: added missing last argument to RTR_?_region calls confic.c: merged with configmac.c, added 1993 to copyright message fileobject.c: int compared to NULL in writestring(); change fopenRF ifdef timemodule.c: simplify times() using mkvalue; include myselect.h earlier (for sequent). posixmodule: for sequent, include unistd.h instead of explicit extern definitions and don't define rename() Makefile: change misleading/wrong MD5 comments
This commit is contained in:
parent
80530ce875
commit
0b0db8e3a0
8 changed files with 367 additions and 160 deletions
|
@ -75,6 +75,9 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "modsupport.h"
|
||||
#include "ceval.h"
|
||||
|
||||
#ifdef _SEQUENT_
|
||||
#include <unistd.h>
|
||||
#else /* _SEQUENT_ */
|
||||
/* XXX Aren't these always declared in unistd.h? */
|
||||
extern char *strerror PROTO((int));
|
||||
extern int chmod PROTO((const char *, mode_t));
|
||||
|
@ -87,6 +90,7 @@ extern int rmdir PROTO((const char *));
|
|||
extern int stat PROTO((const char *, struct stat *));
|
||||
extern int unlink PROTO((const char *));
|
||||
extern int pclose PROTO((FILE *));
|
||||
#endif /* _SEQUENT_ */
|
||||
#ifdef NO_LSTAT
|
||||
#define lstat stat
|
||||
#else
|
||||
|
@ -375,7 +379,7 @@ posix_nice(self, args)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef i386
|
||||
#if i386 && ! _SEQUENT_
|
||||
int
|
||||
rename(from, to)
|
||||
char *from;
|
||||
|
@ -388,7 +392,7 @@ rename(from, to)
|
|||
return status;
|
||||
return unlink(from);
|
||||
}
|
||||
#endif /* i386 */
|
||||
#endif /* i386 && ! _SEQUENT_ */
|
||||
|
||||
static object *
|
||||
posix_rename(self, args)
|
||||
|
@ -833,7 +837,6 @@ posix_times(self, args)
|
|||
{
|
||||
struct tms t;
|
||||
clock_t c;
|
||||
object *tuple;
|
||||
if (!getnoarg(args))
|
||||
return NULL;
|
||||
errno = 0;
|
||||
|
@ -842,18 +845,11 @@ posix_times(self, args)
|
|||
err_errno(PosixError);
|
||||
return NULL;
|
||||
}
|
||||
tuple = newtupleobject(4);
|
||||
if (tuple == NULL)
|
||||
return NULL;
|
||||
settupleitem(tuple, 0, newfloatobject((double)t.tms_utime / HZ));
|
||||
settupleitem(tuple, 1, newfloatobject((double)t.tms_stime / HZ));
|
||||
settupleitem(tuple, 2, newfloatobject((double)t.tms_cutime / HZ));
|
||||
settupleitem(tuple, 3, newfloatobject((double)t.tms_cstime / HZ));
|
||||
if (err_occurred()) {
|
||||
DECREF(tuple);
|
||||
return NULL;
|
||||
}
|
||||
return tuple;
|
||||
return mkvalue("dddd",
|
||||
(double)t.tms_utime / HZ,
|
||||
(double)t.tms_stime / HZ,
|
||||
(double)t.tms_cutime / HZ,
|
||||
(double)t.tms_cstime / HZ);
|
||||
}
|
||||
|
||||
#endif /* DO_TIMES */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue