- {
- int in, out;
- struct stat st;
-
- if ((in = open(altmsg, O_RDONLY)) == NOTOK)
- adios(altmsg, "unable to open");
- fstat(in, &st);
- if ((out = creat(distfile,
- (int) st.st_mode & 0777))
- == NOTOK)
- adios(distfile, "unable to write");
- cpydata(in, out, altmsg, distfile);
- close(in);
- close(out);
+ if ((in = open(altmsg, O_RDONLY)) == NOTOK) {
+ adios(altmsg, "unable to open");
+ }
+ fstat(in, &st2);
+ if ((out = creat(distfile, (int)st2.st_mode & 0777)) ==
+ NOTOK) {
+ adios(distfile, "unable to write");