equal
deleted
inserted
replaced
1196 |
1196 |
1197 /** Expand a pattern into a buffer starting at pos and open a file using constructed path */ |
1197 /** Expand a pattern into a buffer starting at pos and open a file using constructed path */ |
1198 static int expand_and_open(const char* pattern, char* buf, size_t buflen, size_t pos) { |
1198 static int expand_and_open(const char* pattern, char* buf, size_t buflen, size_t pos) { |
1199 int fd = -1; |
1199 int fd = -1; |
1200 if (Arguments::copy_expand_pid(pattern, strlen(pattern), &buf[pos], buflen - pos)) { |
1200 if (Arguments::copy_expand_pid(pattern, strlen(pattern), &buf[pos], buflen - pos)) { |
1201 fd = open(buf, O_RDWR | O_CREAT, 0666); |
1201 fd = open(buf, O_RDWR | O_CREAT | O_TRUNC, 0666); |
1202 } |
1202 } |
1203 return fd; |
1203 return fd; |
1204 } |
1204 } |
1205 |
1205 |
1206 /** |
1206 /** |