New test for getppid(), by Alexey Tourbin
[p5sagit/p5-mst-13.2.git] / doio.c
diff --git a/doio.c b/doio.c
index d3b27c7..81a0f65 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -103,7 +103,7 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
     /* Collect default raw/crlf info from the op */
     if (PL_op && PL_op->op_type == OP_OPEN) {
        /* set up IO layers */
-       U8 flags = PL_op->op_private;
+       const U8 flags = PL_op->op_private;
        in_raw = (flags & OPpOPEN_IN_RAW);
        in_crlf = (flags & OPpOPEN_IN_CRLF);
        out_raw = (flags & OPpOPEN_OUT_RAW);
@@ -822,7 +822,7 @@ Perl_nextargv(pTHX_ register GV *gv)
                        sv_catpv(sv,PL_inplace);
                    }
 #ifndef FLEXFILENAMES
-                   if ((PerlLIO_stat(SvPVX(sv),&PL_statbuf) >= 0
+                   if ((PerlLIO_stat(SvPVX_const(sv),&PL_statbuf) >= 0
                         && PL_statbuf.st_dev == filedev
                         && PL_statbuf.st_ino == fileino)
 #ifdef DJGPP
@@ -840,7 +840,7 @@ Perl_nextargv(pTHX_ register GV *gv)
 #endif
 #ifdef HAS_RENAME
 #if !defined(DOSISH) && !defined(__CYGWIN__) && !defined(EPOC)
-                   if (PerlLIO_rename(PL_oldname,SvPVX(sv)) < 0) {
+                   if (PerlLIO_rename(PL_oldname,SvPVX_const(sv)) < 0) {
                        if (ckWARN_d(WARN_INPLACE))     
                            Perl_warner(aTHX_ packWARN(WARN_INPLACE),
                              "Can't rename %s to %"SVf": %s, skipping file",
@@ -850,13 +850,13 @@ Perl_nextargv(pTHX_ register GV *gv)
                    }
 #else
                    do_close(gv,FALSE);
-                   (void)PerlLIO_unlink(SvPVX(sv));
-                   (void)PerlLIO_rename(PL_oldname,SvPVX(sv));
+                   (void)PerlLIO_unlink(SvPVX_const(sv));
+                   (void)PerlLIO_rename(PL_oldname,SvPVX_const(sv));
                    do_open(gv,SvPVX(sv),SvCUR(sv),PL_inplace!=0,O_RDONLY,0,Nullfp);
 #endif /* DOSISH */
 #else
-                   (void)UNLINK(SvPVX(sv));
-                   if (link(PL_oldname,SvPVX(sv)) < 0) {
+                   (void)UNLINK(SvPVX_const(sv));
+                   if (link(PL_oldname,SvPVX_const(sv)) < 0) {
                        if (ckWARN_d(WARN_INPLACE))     
                            Perl_warner(aTHX_ packWARN(WARN_INPLACE),
                              "Can't rename %s to %"SVf": %s, skipping file",
@@ -1046,7 +1046,7 @@ Perl_io_close(pTHX_ IO *io, bool not_implicit)
            const int status = PerlProc_pclose(IoIFP(io));
            if (not_implicit) {
                STATUS_NATIVE_SET(status);
-               retval = (STATUS_POSIX == 0);
+               retval = (STATUS_UNIX == 0);
            }
            else {
                retval = (status != -1);
@@ -1407,7 +1407,7 @@ Perl_my_stat(pTHX)
        s = SvPV(sv, len);
        PL_statgv = Nullgv;
        sv_setpvn(PL_statname, s, len);
-       s = SvPVX(PL_statname);         /* s now NUL-terminated */
+       s = SvPVX_const(PL_statname);           /* s now NUL-terminated */
        PL_laststype = OP_STAT;
        PL_laststatval = PerlLIO_stat(s, &PL_statcache);
        if (PL_laststatval < 0 && ckWARN(WARN_NEWLINE) && strchr(s, '\n'))
@@ -1883,7 +1883,7 @@ nothing in the core.
 #ifndef VMS /* VMS' cando is in vms.c */
 bool
 Perl_cando(pTHX_ Mode_t mode, Uid_t effective, register const Stat_t *statbufp)
-/* Note: we use `effective' both for uids and gids.
+/* Note: we use "effective" both for uids and gids.
  * Here we are betting on Uid_t being equal or wider than Gid_t.  */
 {
 #ifdef DOSISH
@@ -2000,7 +2000,8 @@ Perl_do_ipcctl(pTHX_ I32 optype, SV **mark, SV **sp)
 {
     SV *astr;
     char *a;
-    I32 infosize, getinfo;
+    STRLEN infosize;
+    I32 getinfo;
     I32 ret = -1;
     const I32 id  = SvIVx(*++mark);
     const I32 n   = (optype == OP_SEMCTL) ? SvIVx(*++mark) : 0;
@@ -2356,7 +2357,7 @@ Perl_start_glob (pTHX_ SV *tmpglob, IO *io)
        }
        if ((tmpfp = PerlIO_tmpfile()) != NULL) {
            Stat_t st;
-           if (!PerlLIO_stat(SvPVX(tmpglob),&st) && S_ISDIR(st.st_mode))
+           if (!PerlLIO_stat(SvPVX_const(tmpglob),&st) && S_ISDIR(st.st_mode))
                ok = ((wilddsc.dsc$a_pointer = tovmspath(SvPVX(tmpglob),vmsspec)) != NULL);
            else ok = ((wilddsc.dsc$a_pointer = tovmsspec(SvPVX(tmpglob),vmsspec)) != NULL);
            if (ok) wilddsc.dsc$w_length = (unsigned short int) strlen(wilddsc.dsc$a_pointer);
@@ -2451,5 +2452,5 @@ Perl_start_glob (pTHX_ SV *tmpglob, IO *io)
  * indent-tabs-mode: t
  * End:
  *
- * vim: ts=8 sts=4 sw=4 noet:
-*/
+ * ex: set ts=8 sts=4 sw=4 noet:
+ */