~ubuntu-branches/ubuntu/dapper/sup/dapper

« back to all changes in this revision

Viewing changes to supcmeat.c

  • Committer: Bazaar Package Importer
  • Author(s): Jochen Friedrich
  • Date: 2003-12-30 22:02:24 UTC
  • Revision ID: james.westby@ubuntu.com-20031230220224-g6rzexudlhhtk3nv
Tags: 1.8-10
* Bumped standards version to 3.6.1 (no changes required).
* Fixed errno handling (Thanks to Thorsten Sauter <tsauter@debian.org>
  for the patch) (Closes: #223422).
* Corrected debian/copyright.
* Documented IPv6 options in man page.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1128
1128
        /* try destination directory */
1129
1129
                path (to,dpart,fpart);
1130
1130
                (void) sprintf (tname,"%s/#%d.sup",dpart,thispid);
1131
 
                tof = open (tname,(O_WRONLY|O_CREAT|O_TRUNC),0600);
 
1131
                tof = open (tname,(O_WRONLY|O_CREAT|O_TRUNC|O_EXCL),0600);
1132
1132
                if (tof >= 0)  break;
1133
1133
        /* try sup directory */
1134
1134
                if (thisC->Cprefix)  (void) chdir (thisC->Cbase);
1135
1135
                (void) sprintf (tname,"sup/#%d.sup",thispid);
1136
 
                tof = open (tname,(O_WRONLY|O_CREAT|O_TRUNC),0600);
 
1136
                tof = open (tname,(O_WRONLY|O_CREAT|O_TRUNC|O_EXCL),0600);
1137
1137
                if (tof >= 0) {
1138
1138
                        if (thisC->Cprefix)  (void) chdir (thisC->Cprefix);
1139
1139
                        break;
1140
1140
                }
1141
1141
        /* try base directory */
1142
1142
                (void) sprintf (tname,"#%d.sup",thispid);
1143
 
                tof = open (tname,(O_WRONLY|O_CREAT|O_TRUNC),0600);
 
1143
                tof = open (tname,(O_WRONLY|O_CREAT|O_TRUNC|O_EXCL),0600);
1144
1144
                if (thisC->Cprefix)  (void) chdir (thisC->Cprefix);
1145
1145
                if (tof >= 0)  break;
1146
1146
#ifdef  VAR_TMP
1147
1147
        /* try /var/tmp */
1148
1148
                (void) sprintf (tname,"/var/tmp/#%d.sup",thispid);
1149
 
                tof = open (tname,(O_WRONLY|O_CREAT|O_TRUNC),0600);
 
1149
                tof = open (tname,(O_WRONLY|O_CREAT|O_TRUNC|O_EXCL),0600);
1150
1150
                if (tof >= 0)  break;
1151
1151
#else
1152
1152
        /* try /usr/tmp */
1153
1153
                (void) sprintf (tname,"/usr/tmp/#%d.sup",thispid);
1154
 
                tof = open (tname,(O_WRONLY|O_CREAT|O_TRUNC),0600);
 
1154
                tof = open (tname,(O_WRONLY|O_CREAT|O_TRUNC|O_EXCL),0600);
1155
1155
                if (tof >= 0)  break;
1156
1156
#endif
1157
1157
        /* try /tmp */
1158
1158
                (void) sprintf (tname,"/tmp/#%d.sup",thispid);
1159
 
                tof = open (tname,(O_WRONLY|O_CREAT|O_TRUNC),0600);
 
1159
                tof = open (tname,(O_WRONLY|O_CREAT|O_TRUNC|O_EXCL),0600);
1160
1160
                if (tof >= 0)  break;
1161
1161
                istemp = FALSE;
1162
1162
        /* give up: try to create output file */
1163
1163
                if (!docompress)
1164
 
                        tof = open (to,(O_WRONLY|O_CREAT|O_TRUNC),0600);
 
1164
                        tof = open (to,(O_WRONLY|O_CREAT|O_TRUNC|O_EXCL),0600);
1165
1165
                if (tof >= 0)  break;
1166
1166
        /* no luck */
1167
1167
                notify ("SUP: Can't create %s or temp file for it\n",to);