Skip to content

Commit

Permalink
Fix: os.Mkdir("/dev") instead if os.Mkdir("/dev/shm")
Browse files Browse the repository at this point in the history
As os.Mkdir("/dev/shm") returns error as /dev not exists so instead we should just create /dev and /dev/shm created in the next lines of code

Signed-off-by: GLVSKiriti <[email protected]>
  • Loading branch information
GLVSKiriti committed Apr 22, 2024
1 parent 40ac2b5 commit b920191
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion events/syscall/execution_from_dev_shm.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func ExecutionFromDevShm(h events.Helper) error {

// Check if /dev exists
if _, err := os.Stat("/dev"); os.IsNotExist(err) {
if err := os.Mkdir("/dev/shm", 0755); err != nil {
if err := os.Mkdir("/dev", 0755); err != nil {
return err
}
defer os.RemoveAll("/dev") // Remove dev directory
Expand Down

0 comments on commit b920191

Please sign in to comment.