1 /* |
1 /* |
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
3 * |
3 * |
4 * Copyright 2015 Olaf Wintermann. All rights reserved. |
4 * Copyright 2016 Olaf Wintermann. All rights reserved. |
5 * |
5 * |
6 * Redistribution and use in source and binary forms, with or without |
6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions are met: |
7 * modification, are permitted provided that the following conditions are met: |
8 * |
8 * |
9 * 1. Redistributions of source code must retain the above copyright |
9 * 1. Redistributions of source code must retain the above copyright |
186 |
186 |
187 // create trash directory |
187 // create trash directory |
188 mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; |
188 mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; |
189 if (util_mkdir(dir->trash, mode)) { |
189 if (util_mkdir(dir->trash, mode)) { |
190 if (errno != EEXIST) { |
190 if (errno != EEXIST) { |
191 fprintf(stderr, "Cannot create trash directory.\n"); |
191 fprintf(stderr, "Cannot create trash directory: %s\n", dir->trash); |
192 } |
192 } |
193 } |
193 } |
194 } else { |
194 } else { |
195 dir->trash = NULL; |
195 dir->trash = NULL; |
196 } |
196 } |