@@ -194,7 +194,7 @@ String read_file(StringView filename, bool text)
194194 if (fd == -1 )
195195 throw file_access_error (filename, strerror (errno));
196196
197- auto close_fd = on_scope_end ([fd]{ close (fd); });
197+ auto close_fd = OnScopeEnd ([fd]{ close (fd); });
198198 return read_fd (fd, text);
199199}
200200
@@ -204,7 +204,7 @@ MappedFile::MappedFile(StringView filename)
204204 int fd = open (filename.zstr (), O_RDONLY | O_NONBLOCK);
205205 if (fd == -1 )
206206 throw file_access_error (filename, strerror (errno));
207- auto close_fd = on_scope_end ([&] { close (fd); });
207+ auto close_fd = OnScopeEnd ([&] { close (fd); });
208208
209209 fstat (fd, &st);
210210 if (S_ISDIR (st.st_mode ))
@@ -253,7 +253,7 @@ void write(int fd, StringView data)
253253 int flags = fcntl (fd, F_GETFL, 0 );
254254 if (not atomic and EventManager::has_instance ())
255255 fcntl (fd, F_SETFL, flags | O_NONBLOCK);
256- auto restore_flags = on_scope_end ([&] { fcntl (fd, F_SETFL, flags); });
256+ auto restore_flags = OnScopeEnd ([&] { fcntl (fd, F_SETFL, flags); });
257257
258258 while (count)
259259 {
@@ -291,7 +291,7 @@ void write_to_file(StringView filename, StringView data)
291291 int fd = create_file (filename.zstr ());
292292 if (fd == -1 )
293293 throw file_access_error (filename, strerror (errno));
294- auto close_fd = on_scope_end ([fd]{ close (fd); });
294+ auto close_fd = OnScopeEnd ([fd]{ close (fd); });
295295 write (fd, data);
296296}
297297
@@ -358,7 +358,7 @@ void make_directory(StringView dir, mode_t mode)
358358 else
359359 {
360360 auto old_mask = umask (0 );
361- auto restore_mask = on_scope_end ([old_mask]() { umask (old_mask); });
361+ auto restore_mask = OnScopeEnd ([old_mask]() { umask (old_mask); });
362362
363363 if (mkdir (dirname.zstr (), mode) != 0 )
364364 throw runtime_error (format (" mkdir failed for directory '{}' errno {}" , dirname, errno));
@@ -374,7 +374,7 @@ void list_files(StringView dirname, FunctionRef<void (StringView, const struct s
374374 if (not dir)
375375 return ;
376376
377- auto close_dir = on_scope_end ([dir]{ closedir (dir); });
377+ auto close_dir = OnScopeEnd ([dir]{ closedir (dir); });
378378
379379 while (dirent* entry = readdir (dir))
380380 {
0 commit comments