/* Return needed to persuade SDCC all is ok */
return NULL;
}
- rdtime(&t);
- mnt->m_fs.s_time = t.low;
- mnt->m_fs.s_timeh = t.high;
- mnt->m_fs.s_fmod = FMOD_DIRTY;
+ if (!(mnt->m_flags & MS_RDONLY)) {
+ rdtime(&t);
+ mnt->m_fs.s_time = t.low;
+ mnt->m_fs.s_timeh = t.high;
+ mnt->m_fs.s_fmod = FMOD_DIRTY;
+ }
return &mnt->m_fs;
}
can't remount it read only */
if (flags & (MS_RDONLY|MS_REMOUNT) == (MS_RDONLY|MS_REMOUNT)) {
for (ptr = i_tab ; ptr < i_tab + ITABSIZE; ++ptr) {
- if (ptr->c_dev == dev && ptr->c_writers) {
+ if (ptr->c_dev == dev && ptr->c_writers &&
+ !isdevice(ptr)) {
udata.u_error = EBUSY;
return -1;
}
/* Sweep the inode table. If unmounting look for any references
and if so fail. If remounting update the CRDONLY flags */
for (ptr = i_tab; ptr < i_tab + ITABSIZE; ++ptr) {
- if (ptr->c_refs > 0 && ptr->c_dev == dev) {
+ if (ptr->c_dev == dev) {
if (rm) {
ptr->c_flags &= ~CRDONLY;
if (flags & MS_RDONLY)
ptr->c_flags |= CRDONLY;
- } else {
+ else
+ ptr->c_flags &= ~CRDONLY;
+ } else if (ptr->c_refs) {
udata.u_error = EBUSY;
return -1;
}